Check for updates, log more info.

This commit is contained in:
2025-09-21 01:26:08 +02:00
parent 25961b3f6f
commit 647bfc1987

View File

@@ -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.