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 done
log "Configured watchdog to ping: ${ip_array[*]}" log "Configured watchdog to ping: ${ip_array[*]}"
# Restart watchdog service # Attempt to restart watchdog service
if sudo systemctl restart watchdog; then if ! sudo systemctl restart watchdog; then
log "Watchdog service restarted successfully." 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 if sudo systemctl stop watchdog-monitor; then
log "watchdog-monitor service stopped successfully." log "watchdog-monitor service stopped successfully."
else else
log "Failed to stop watchdog-monitor service." log "Failed to stop watchdog-monitor service."
fi fi
return 0 # Successful restart return 0 # Successful restart/start
else
log "Failed to restart watchdog service."
return 1 # Failed restart
fi
fi fi
} }