header();
if(!Auth::hasPermission('SERVER::MANAGE')) {
?>
footer();
exit();
}
#systemctl status
if(defined('DEMO') && DEMO) {
$result = [];
} else {
$json = shell_exec('systemctl list-units --type=service --output=json-pretty'); //TODO convert for other OS envs as well
if (empty($json)) {
$result = [];
} else {
$result = json_decode($json, false);
}
}
?>