mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
22 lines
416 B
PHP
22 lines
416 B
PHP
|
<?php
|
||
|
|
||
|
require '../../includes/csrf.php';
|
||
|
|
||
|
$action = escapeshellcmd($_POST['a']);
|
||
|
|
||
|
if (isset($action)) {
|
||
|
|
||
|
switch($action) {
|
||
|
case "reboot":
|
||
|
$response = shell_exec("sudo /sbin/reboot");
|
||
|
break;
|
||
|
case "shutdown":
|
||
|
$response = shell_exec("sudo /sbin/shutdown -h now");
|
||
|
break;
|
||
|
default:
|
||
|
$response = 'Unknown action: '.$action;
|
||
|
}
|
||
|
echo json_encode($response);
|
||
|
}
|
||
|
|