From ccfea088b9987712aacf12d8f3ff293131eb913e Mon Sep 17 00:00:00 2001 From: Jali Date: Sun, 21 Sep 2025 01:40:07 +0200 Subject: [PATCH] Change writing and remove unneeded $ --- services/git-monitor | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/services/git-monitor b/services/git-monitor index 3028ae8..9e9d3c7 100755 --- a/services/git-monitor +++ b/services/git-monitor @@ -35,11 +35,11 @@ run_after() { } initialize_repos() { - while read -r REPO_NAME REPO_URL; do - if [ ! -d "$REPO_LOCAL_PATH/$REPO_NAME" ]; then + while read -r repo_name repo_url; do + if [ ! -d "$REPO_LOCAL_PATH/$repo_name" ]; then log_message "INFO" "Repository directory $REPO_LOCAL_PATH/$REOP_NAME does not exist. Cloning..." - mkdir -p "$REPO_LOCAL_PATH/$REPO_NAME" - git clone --depth 1 "$REPO_URL" "$REPO_LOCAL_PATH/$REPO_NAME" + mkdir -p "$REPO_LOCAL_PATH/$repo_name" + git clone --depth 1 "$REPO_URL" "$REPO_LOCAL_PATH/$repo_name" if [ $? -ne 0 ]; then log_message "ERROR" "Failed to clone repository. Exiting." exit 1 @@ -92,10 +92,10 @@ log_message "INFO" "Git monitor started." initialize_repos while true; do - while read -r $REPO_NAME $REPO_URL; do - check_for_updates $REPO_NAME - if [ -f "$REPO_LOCAL_PATH/$REPO_NAME/.git-monitor_after.sh" ]; then - run_after "$REPO_LOCAL_PATH/$REPO_NAME/.git-monitor_after.sh" + while read -r repo_name repo_url; do + check_for_updates $repo_name + if [ -f "$REPO_LOCAL_PATH/$repo_name/.git-monitor_after.sh" ]; then + run_after "$REPO_LOCAL_PATH/$repo_name/.git-monitor_after.sh" fi done < $REPO_URLS sleep "$POLL_INTERVAL"