set return status for cancel and restart commands

This commit is contained in:
Andrew Bauer 2020-10-14 12:22:21 -05:00
parent a60815a700
commit e69b3800c7
1 changed files with 3 additions and 3 deletions

View File

@ -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;