commit b933ad4fc959f858158267762307cb4775a01b55 Author: Tobias P Date: Tue Sep 26 14:57:16 2023 +0200 initial commit 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; +?>