Only run the run_after stage, when a successful pull happened.
This commit is contained in:
@@ -72,6 +72,11 @@ check_for_updates() {
|
|||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
log_message "INFO" "Pull successful."
|
log_message "INFO" "Pull successful."
|
||||||
|
|
||||||
|
# run local scripts
|
||||||
|
if [ -f "$REPO_LOCAL_PATH/$repo_name/.git-monitor_after.sh" ]; then
|
||||||
|
run_after "$REPO_LOCAL_PATH/$repo_name/.git-monitor_after.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
# Update the last commit hash file
|
# Update the last commit hash file
|
||||||
echo "$current_commit_hash" > "$REPO_LOCAL_PATH/$repo_name/.git-monitor-last-commit"
|
echo "$current_commit_hash" > "$REPO_LOCAL_PATH/$repo_name/.git-monitor-last-commit"
|
||||||
else
|
else
|
||||||
@@ -94,9 +99,6 @@ initialize_repos
|
|||||||
while true; do
|
while true; do
|
||||||
while read -r repo_name repo_url; do
|
while read -r repo_name repo_url; do
|
||||||
check_for_updates $repo_name
|
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
|
done < $REPO_URLS
|
||||||
sleep "$POLL_INTERVAL"
|
sleep "$POLL_INTERVAL"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user