From e61dbdabe38eb1b5b4bc93da6930c3aae3fade05 Mon Sep 17 00:00:00 2001 From: akuker Date: Fri, 7 Aug 2020 17:03:47 -0500 Subject: [PATCH] Enabled Shtudown & reboot commands --- src/php/rascsi_action.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/php/rascsi_action.php b/src/php/rascsi_action.php index 581b196e..ec6740ad 100644 --- a/src/php/rascsi_action.php +++ b/src/php/rascsi_action.php @@ -167,9 +167,11 @@ function action_stop_rascsi_service(){ function action_reboot_raspberry_pi(){ // Check to see if the user has confirmed if(isset($_POST['confirmed'])){ - echo('
exec(sleep 2 && sudo reboot)'); - // The unit should reboot at this point. Doesn't matter what we do now... - html_generate_ok_to_go_home(); + $command = "sleep 2 && sudo reboot 2>&1"; + exec($command, $retArray, $result); + // The unit should reboot at this point. Doesn't matter what we do now... + check_result($result, $command,$retArray); + html_generate_ok_to_go_home(); } else{ check_are_you_sure("Are you sure you want to reboot the Raspberry Pi?"); @@ -179,8 +181,10 @@ function action_reboot_raspberry_pi(){ function action_shutdown_raspberry_pi(){ // Check to see if the user has confirmed if(isset($_POST['confirmed'])){ - echo('
exec(sleep 2 && sudo shutdown -h now)'); - // The unit should reboot at this point. Doesn't matter what we do now... + $command = "sleep 2 && sudo shutdown -h now 2>&1"; + exec($command, $retArray, $result); + // The unit should shutdown at this point. Doesn't matter what we do now... + check_result($result, $command,$retArray); html_generate_ok_to_go_home(); } else{