Updated exit code
This commit is contained in:
parent
67ab931f57
commit
8dbba4e9d0
14
webcron.php
14
webcron.php
|
@ -40,15 +40,13 @@ if (file_exists("cache/get-services.trigger")) {
|
||||||
$rebootjobs = unserialize(file_get_contents("cache/get-services.trigger"));
|
$rebootjobs = unserialize(file_get_contents("cache/get-services.trigger"));
|
||||||
|
|
||||||
foreach($rebootjobs as $job) {
|
foreach($rebootjobs as $job) {
|
||||||
if($job['expected'] != 0) {
|
$services = array();
|
||||||
$services = array();
|
$url = "ssh " . $job['host'] . " '" . "sudo systemctl list-units | cat" . "' 2>&1";
|
||||||
$url = "ssh " . $job['host'] . " '" . "sudo systemctl list-units | cat" . "' 2>&1";
|
exec($url, $services);
|
||||||
exec($url, $services);
|
$services = implode("\n", $services);
|
||||||
$services = implode("\n", $services);
|
|
||||||
|
|
||||||
$stmt = $db->prepare("INSERT INTO runs(job, statuscode, result, timestamp) VALUES(?, ?, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO runs(job, statuscode, result, timestamp) VALUES(?, ?, ?, ?)");
|
||||||
$stmt->execute(array($job['jobID'], '200', $services, time()));
|
$stmt->execute(array($job['jobID'], '1', $services, time()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
unlink("cache/get-services.trigger");
|
unlink("cache/get-services.trigger");
|
||||||
unlink("cache/reboot-time.trigger");
|
unlink("cache/reboot-time.trigger");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user