mirror of
https://github.com/thewesker/RASCSI.git
synced 2025-12-20 20:31:24 -05:00
Enabled Shtudown & reboot commands
This commit is contained in:
@@ -167,9 +167,11 @@ function action_stop_rascsi_service(){
|
|||||||
function action_reboot_raspberry_pi(){
|
function action_reboot_raspberry_pi(){
|
||||||
// Check to see if the user has confirmed
|
// Check to see if the user has confirmed
|
||||||
if(isset($_POST['confirmed'])){
|
if(isset($_POST['confirmed'])){
|
||||||
echo('<br>exec(sleep 2 && sudo reboot)');
|
$command = "sleep 2 && sudo reboot 2>&1";
|
||||||
// The unit should reboot at this point. Doesn't matter what we do now...
|
exec($command, $retArray, $result);
|
||||||
html_generate_ok_to_go_home();
|
// 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{
|
else{
|
||||||
check_are_you_sure("Are you sure you want to reboot the Raspberry Pi?");
|
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(){
|
function action_shutdown_raspberry_pi(){
|
||||||
// Check to see if the user has confirmed
|
// Check to see if the user has confirmed
|
||||||
if(isset($_POST['confirmed'])){
|
if(isset($_POST['confirmed'])){
|
||||||
echo('<br>exec(sleep 2 && sudo shutdown -h now)');
|
$command = "sleep 2 && sudo shutdown -h now 2>&1";
|
||||||
// The unit should reboot at this point. Doesn't matter what we do now...
|
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();
|
html_generate_ok_to_go_home();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
Reference in New Issue
Block a user