diff --git a/services/git-monitor b/services/git-monitor index 6d50270..abf78b0 100755 --- a/services/git-monitor +++ b/services/git-monitor @@ -29,10 +29,6 @@ create_lock() { touch "$LOCK_FILE" } -remove_lock() { - rm -f "$LOCK_FILE" -} - run_after() { local after_pull_script=$1 source $after_pull_script @@ -59,6 +55,7 @@ check_for_updates() { local current_commit_hash # Get the last known commit hash (from a file) + echo "$REPO_LOCAL_PATH/$REPO_NAME" cd "$REPO_LOCAL_PATH/$REPO_NAME" if [ -f "$REPO_LOCAL_PATH/$repo_name/.git-monitor-last-commit" ]; then last_commit_hash=$(cat "$REPO_LOCAL_PATH/$repo_name/.git-monitor-last-commit") @@ -85,7 +82,7 @@ check_for_updates() { # Main Execution -trap 'remove_lock' EXIT +trap 'rm -f $LOCKFILE' EXIT check_lock create_lock @@ -104,4 +101,3 @@ while true; do sleep "$POLL_INTERVAL" done -remove_lock # This won't be reached in this infinite loop. Useful if exiting gracefully.