From 557ac9d19c8d766da87a9a101dc381274a03531b Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Wed, 10 May 2017 14:26:46 +0200 Subject: [PATCH] On demand bash scripts? No problemo :) --- runnow.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/runnow.php b/runnow.php index dba85a7..85d9c3d 100644 --- a/runnow.php +++ b/runnow.php @@ -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; }