From 5771bc2d158a1f1b6cadedb39e1976262c1267cd Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Thu, 5 Mar 2020 03:35:16 +0100 Subject: [PATCH] rewrote some stuff --- strassenkind.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/strassenkind.php b/strassenkind.php index 03d600b..3e1f0f0 100644 --- a/strassenkind.php +++ b/strassenkind.php @@ -34,17 +34,8 @@ echo "Done."; } else { echo "
"; } - ?> - $command \n
 $output 
\n
"; - } - } else { - //run status command list otherwise - foreach ($status_commands as $command) { + function execute_command_list($commands){ + foreach ($commands as $command) { if ($command != ""){ // === is here on purpose. if (strpos($command, '>') === false) { @@ -54,6 +45,15 @@ echo "Done."; echo "
 $command 
\n
 $output 
\n
"; } } + + } + + // run ondemand command list if demanded + if (isset($_POST['ondemand'])) { + execute_command_list($ondemand_commands); + } else { + //run status command list otherwise + execute_command_list($status_commands); } ?>