From e69b3800c7a51b1a8299b654b7d1b9286a236d48 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Wed, 14 Oct 2020 12:22:21 -0500 Subject: [PATCH] set return status for cancel and restart commands --- web/ajax/shutdown.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/ajax/shutdown.php b/web/ajax/shutdown.php index 353ba79be..8b474b495 100644 --- a/web/ajax/shutdown.php +++ b/web/ajax/shutdown.php @@ -42,12 +42,12 @@ if ( $command == 'shutdown' ) { #ZM\Debug("Shutdown output " . shell_exec('/bin/systemctl poweroff -i 2>&1')); } else if ( $command == 'restart' ) { $data['output'] = array(); - exec('sudo -n '.ZM_PATH_SHUTDOWN." -r $when 2>&1", $data['output']); - #exec('sudo -n /bin/systemctl reboot -i 2>&1', $data['output']); + exec('sudo -n '.ZM_PATH_SHUTDOWN." -r $when 2>&1", $data['output'], $data['rc']); + #exec('sudo -n /bin/systemctl reboot -i 2>&1', $data['output'], $data['rc']); ZM\Debug("Shutdown output " . implode("\n",$data['output'])); } else if ( $command == 'cancel' ) { $data['output'] = array(); - exec('sudo '.ZM_PATH_SHUTDOWN.' -c 2>&1', $data['output']); + exec('sudo '.ZM_PATH_SHUTDOWN.' -c 2>&1', $data['output'], $data['rc']); } else { ajaxError('Unknwn command:'.$command); return;