Initial Commit
This commit is contained in:
22
server_command.php
Normal file
22
server_command.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if (!isset($_GET['action'])) {
|
||||
http_response_code(400);
|
||||
echo "No action given";
|
||||
exit;
|
||||
}
|
||||
|
||||
$action = $_GET['action'];
|
||||
switch ($action) {
|
||||
case 'shutdown':
|
||||
shell_exec('shutdown now');
|
||||
echo "Shutting down...";
|
||||
break;
|
||||
case 'reboot':
|
||||
shell_exec('reboot');
|
||||
echo "Rebooting...";
|
||||
break;
|
||||
default:
|
||||
http_response_code(400);
|
||||
echo "Unknown action";
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user