diff --git a/usr/bin/custom/watchdog-monitor b/usr/bin/custom/watchdog-monitor index fdee08f..dc6c0a4 100644 --- a/usr/bin/custom/watchdog-monitor +++ b/usr/bin/custom/watchdog-monitor @@ -28,9 +28,9 @@ update_watchdog_config() { # Set interval echo "interval = 59" | sudo tee -a "$config_file" > /dev/null + if [ ${#ip_array[@]} -eq 0 ]; then echo "No IP addresses found. Watchdog configuration cleared." >> "$log_file" - return 0 # Indicate that no IP addresses were found else for ip in "${ip_array[@]}"; do echo "ping = $ip" | sudo tee -a "$config_file" > /dev/null