From b933ad4fc959f858158267762307cb4775a01b55 Mon Sep 17 00:00:00 2001 From: Tobias P Date: Tue, 26 Sep 2023 14:57:16 +0200 Subject: [PATCH] initial commit --- .gitignore | 1 + README.md | 5 +++++ src/index.html | 28 ++++++++++++++++++++++++++++ src/restarter.php | 19 +++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 src/index.html create mode 100644 src/restarter.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7ad9fa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.geany diff --git a/README.md b/README.md new file mode 100644 index 0000000..5b4e870 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Service restarter for YunoHost + +## Overview + +restarter is a simple web page for restarting specific, previously hardcoded services. It is a pure convenience project and uses no safety measures whatsoever. Don't use it. No, really, you shouldn't use it. diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..5cd5636 --- /dev/null +++ b/src/index.html @@ -0,0 +1,28 @@ + + + + Restarter + + + + + +
+
+ + diff --git a/src/restarter.php b/src/restarter.php new file mode 100644 index 0000000..3fafaa2 --- /dev/null +++ b/src/restarter.php @@ -0,0 +1,19 @@ +", $command, "
";//DEBUG + // make sure command exists and is not empty + if ($command === "" || empty($command)) { + echo "empty query"; + die(2); + } + // execute shell command + exec($command, $output, $exitcode); + echo "Output is
", join("
", $output), "

"; + echo "Exit code is ", $exitcode; +?>