#!/usr/bin/env php $config["watchdog"]["timeout"]) { error_log("Exceeded timeout! Restarting lightdm."); exec("systemctl restart lightdm"); // Cooldown delay (give the system time to reinitialize) sleep(60); } if ((time() - $last_heartbeat) > $config["watchdog"]["timeout_reboot"]) { error_log("Exceeded timeout_reboot! Rebooting system."); exec("reboot"); } sleep(5); } } }