On demand bash scripts? No problemo :)

This commit is contained in:
Jeroen De Meerleer 2017-05-10 14:26:46 +02:00
parent bb9d555572
commit 557ac9d19c
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 5 additions and 4 deletions

View File

@ -39,7 +39,7 @@ if ($jobnameResult[0]["user"] != $_SESSION["userID"]) {
die(json_encode(array("error" => "You dirty hacker!")));
}
$nosave = false;
if (filter_var($result["url"], FILTER_VALIDATE_URL)) {
if (filter_var($jobnameResult[0]["url"], FILTER_VALIDATE_URL)) {
$client = new \GuzzleHttp\Client();
$res = $client->request('GET', $jobnameResult[0]['url']);
@ -50,13 +50,14 @@ if (filter_var($result["url"], FILTER_VALIDATE_URL)) {
} else {
if($result["url"] != "reboot") {
if($jobnameResult[0]["url"] != "reboot") {
$body = '';
$statuscode = 0;
exec($result["url"], $body, $statuscode);
exec($jobnameResult[0]["url"], $body, $statuscode);
$body = implode("\n", $body);
$timestamp = time();
} else {
$rebootjobs[] = $result['jobID'];
$rebootjobs[] = $jobnameResult[0]['jobID'];
touch("cache/reboot.trigger");
$nosave = true;
}