From a20d85f54306fb3f4d676f64c72ff73ec226646c Mon Sep 17 00:00:00 2001 From: Tim Eertmoed Date: Mon, 28 Oct 2024 20:05:13 +0100 Subject: [PATCH] usr/bin/custom/watchdog-monitor aktualisiert --- usr/bin/custom/watchdog-monitor | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr/bin/custom/watchdog-monitor b/usr/bin/custom/watchdog-monitor index 7ffedf3..91b2335 100644 --- a/usr/bin/custom/watchdog-monitor +++ b/usr/bin/custom/watchdog-monitor @@ -56,11 +56,12 @@ end_time=$((start_time + 300)) # 5 minutes in seconds interval=30 # Initial interval of 30 seconds while true; do - if ! update_watchdog_config; then - echo "No IP addresses found. Waiting for $interval seconds before checking again..." >> "$log_file" - else + # Check if IP addresses are found and watchdog is updated + if update_watchdog_config; then echo "IP addresses found and watchdog restarted. Exiting loop." >> "$log_file" break # Exit the loop if IP addresses were found + else + echo "No IP addresses found. Waiting for $interval seconds before checking again..." >> "$log_file" fi current_time=$(date +%s) @@ -76,5 +77,5 @@ while true; do sleep $interval done -# Version 1.4: +# Version 1.5: # Created 2024 by Tim Eertmoed @ WiS IT-Solutions GmbH, Germany to work on Raspian as custom PXE init script.