";
} else {
echo "";
}
function execute_command_list($commands){
foreach ($commands as $command) {
if ($command != ""){
// === is here on purpose.
if (strpos($command, '>') === false) {
$command = $command . " 2>&1";
}
$output = shell_exec($command);
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);
}
?>