if the output is not being redirected, read stderr as well

master
BodgeMaster 2020-03-05 03:26:21 +01:00
parent f242fba5c1
commit 94d4de68ef
1 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,10 @@ echo "Done.";
//run status command list otherwise
foreach ($status_commands as $command) {
if ($command != ""){
// === is here on purpose.
if (strpos($command, '>') === false) {
$command = $command . " 2>&1";
}
$output = shell_exec($command);
echo "<pre class=\"commandLine\"> $command </pre>\n<pre class=\"commandLine\"> $output </pre>\n<hr />";
}