fix: if icecast is not running, livestream.service is constantly restarting, but that does not show. make sure a service that is contantly "auto-restart" is show as such
This commit is contained in:
@@ -14,11 +14,17 @@ function service_status($name) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$op = shell_exec("sudo systemctl status ".$name." | grep Active | grep ' active\| activating\|running\|waiting\|start'");
|
$op = shell_exec("sudo systemctl status ".$name." | grep Active");
|
||||||
if(strlen($op) > 0) {
|
if (stripos($op, " active (running)")) {
|
||||||
echo "<span style='color:green'>(active)</span>";
|
echo "<span style='color:green'>(active)</span>";
|
||||||
} else {
|
} elseif (stripos($op, " inactive ")) {
|
||||||
echo "<span style='color:#fc6603'>(inactive)</span>";
|
echo "<span style='color:#fc6603'>(inactive)</span>";
|
||||||
|
} else {
|
||||||
|
$status = "ERROR";
|
||||||
|
if (preg_match("/(\S*)\s*\((\S+)\)/", $op, $matches)) {
|
||||||
|
$status = $matches[1]. " [" . $matches[2] . "]";
|
||||||
|
}
|
||||||
|
echo "<span style='color:red'>($status)</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user