Catching stderr again

This commit is contained in:
Jeroen De Meerleer 2017-09-02 17:11:04 +02:00
parent 5d5d3f06b5
commit b24ed85c76
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ if (filter_var($jobnameResult[0]["url"], FILTER_VALIDATE_URL)) {
if($jobnameResult[0]["url"] != "reboot") {
$body = '';
$statuscode = 0;
$url = "ssh " . $jobnameResult[0]['host'] . " '" . $jobnameResult[0]['url'] . "'";
$url = "ssh " . $jobnameResult[0]['host'] . " '" . $jobnameResult[0]['url'] . "' 2>&1";
exec($url, $body, $statuscode);
$body = implode("\n", $body);
$timestamp = time();

View File

@ -42,7 +42,7 @@ if (file_exists("cache/get-services.trigger")) {
foreach($rebootjobs as $job) {
$services = array();
$url = "ssh " . $job['host'] . " '" . "sudo systemctl list-units | cat" . "'";
$url = "ssh " . $job['host'] . " '" . "sudo systemctl list-units | cat" . "' 2>&1";
exec($url, $services);
$services = implode("\n", $services);
@ -81,7 +81,7 @@ foreach ($results as $result) {
if($result["url"] != "reboot") {
$body = '';
$statuscode = 0;
$url = "ssh " . $result['host'] . " '" . $result['url'] . "'";
$url = "ssh " . $result['host'] . " '" . $result['url'] . "' 2>&1";
exec($url, $body, $statuscode);
$body = implode("\n", $body);
} else {