From 612037a49980ba091667f78046bb33ef45705ef9 Mon Sep 17 00:00:00 2001 From: Christian Kuhtz Date: Mon, 1 Jul 2024 15:07:57 -0700 Subject: [PATCH] suggestion for configurable delay makes the delay configurable and updates the wait message in the log accordingly. --- misc/monitor-all.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/monitor-all.sh b/misc/monitor-all.sh index 79bf0df0..4cff7609 100644 --- a/misc/monitor-all.sh +++ b/misc/monitor-all.sh @@ -28,6 +28,7 @@ done echo '#!/usr/bin/env bash # Read excluded instances from command line arguments excluded_instances=("$@") +pause_delay_in_seconds=300 # (Edit to your needs) echo "Excluded instances: ${excluded_instances[@]}" while true; do @@ -85,9 +86,9 @@ while true; do fi done - # Wait for 5 minutes. (Edit to your needs) - echo "$(date): Pausing for 5 minutes..." - sleep 300 + # Wait for ( ${pause_delay_in_seconds} / 60 ) minutes. + echo "$(date): Pausing for $((${pause_delay_in_seconds}/60)) minutes..." + sleep ${pause_delay_in_seconds} done >/var/log/ping-instances.log 2>&1' >/usr/local/bin/ping-instances.sh touch /var/log/ping-instances.log # Change file permissions to executable