varaverk: System card (identity/time/uptime/buttons); merge Fallback+Partner into one card

This commit is contained in:
Gmer4Lfe
2026-05-24 12:00:09 -04:00
parent 725c371f21
commit 359b051e64
5 changed files with 147 additions and 49 deletions
@@ -0,0 +1,20 @@
<?php
header('Content-Type: application/json');
$body = json_decode(file_get_contents('php://input'), true) ?? [];
$action = $body['action'] ?? '';
$allowed = ['stop', 'shutdown', 'restart'];
if (!in_array($action, $allowed, true)) {
echo json_encode(['ok' => false, 'error' => 'invalid action']);
exit;
}
$cmd = match($action) {
'stop' => '/usr/local/sbin/mdcmd stop',
'shutdown' => '/sbin/shutdown -h now',
'restart' => '/sbin/shutdown -r now',
};
exec($cmd . ' > /dev/null 2>&1 &');
echo json_encode(['ok' => true]);