stable #2

Merged
alientim merged 89 commits from stable into dev 2024-11-15 10:37:11 +01:00
Showing only changes of commit 514cc91ed5 - Show all commits

View File

@@ -43,22 +43,30 @@ update_watchdog_config() {
done
log "Configured watchdog to ping: ${ip_array[*]}"
# Restart watchdog service
if sudo systemctl restart watchdog; then
log "Watchdog service restarted successfully."
# Attempt to restart watchdog service
if ! sudo systemctl restart watchdog; then
log "Failed to restart watchdog service. Attempting to stop and start."
# Stop watchdog-monitor service
# Fallback: stop then start the service
sudo systemctl stop watchdog
if sudo systemctl start watchdog; then
log "Watchdog service started successfully after stop."
else
log "Failed to start watchdog service after stop."
return 1
fi
else
log "Watchdog service restarted successfully."
fi
# Stop watchdog-monitor service if restart/start was successful
if sudo systemctl stop watchdog-monitor; then
log "watchdog-monitor service stopped successfully."
else
log "Failed to stop watchdog-monitor service."
fi
return 0 # Successful restart
else
log "Failed to restart watchdog service."
return 1 # Failed restart
fi
return 0 # Successful restart/start
fi
}