📄 Source: status.php
<?php
require_once __DIR__ . '/../auth.php';
require_once __DIR__ . '/../lib/servers.php';
require_auth_json();
$CFG = $GLOBALS['__CFG'];
$root = $CFG['server_root'];
$names = servers_discover($root);
$out = [];
foreach ($names as $name) {
$state = server_state($root, $name, $CFG);
$enabled = server_autostart_enabled($root, $name, $CFG);
$out[] = [
'name' => $name,
'state' => $state,
'enabled' => $enabled, // true / false / null (no systemd)
];
}
header('Content-Type: application/json');
echo json_encode(['ok' => true, 'servers' => $out]);
← Back