From 8dbba4e9d0967c64b71218818d3b7719386de5fa Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 5 Sep 2018 15:04:24 +0200 Subject: [PATCH] Updated exit code --- webcron.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/webcron.php b/webcron.php index 4236cc7..cd4131c 100644 --- a/webcron.php +++ b/webcron.php @@ -40,15 +40,13 @@ if (file_exists("cache/get-services.trigger")) { $rebootjobs = unserialize(file_get_contents("cache/get-services.trigger")); foreach($rebootjobs as $job) { - if($job['expected'] != 0) { - $services = array(); - $url = "ssh " . $job['host'] . " '" . "sudo systemctl list-units | cat" . "' 2>&1"; - exec($url, $services); - $services = implode("\n", $services); + $services = array(); + $url = "ssh " . $job['host'] . " '" . "sudo systemctl list-units | cat" . "' 2>&1"; + exec($url, $services); + $services = implode("\n", $services); - $stmt = $db->prepare("INSERT INTO runs(job, statuscode, result, timestamp) VALUES(?, ?, ?, ?)"); - $stmt->execute(array($job['jobID'], '200', $services, time())); - } + $stmt = $db->prepare("INSERT INTO runs(job, statuscode, result, timestamp) VALUES(?, ?, ?, ?)"); + $stmt->execute(array($job['jobID'], '1', $services, time())); } unlink("cache/get-services.trigger"); unlink("cache/reboot-time.trigger");