mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Update system_services.php
This commit is contained in:
@@ -57,9 +57,9 @@
|
|||||||
if (!function_exists('is_running')) {
|
if (!function_exists('is_running')) {
|
||||||
function is_running(string $name) {
|
function is_running(string $name) {
|
||||||
$name = escapeshellarg($name);
|
$name = escapeshellarg($name);
|
||||||
$pid = trim(shell_exec("ps -aux | grep $name | grep -v grep | awk '{print \$2}' | head -n 1"));
|
$pid = shell_exec("ps -aux | grep $name | grep -v grep | awk '{print \$2}' | head -n 1");
|
||||||
if ($pid && is_numeric($pid)) {
|
if ($pid && is_numeric($pid)) {
|
||||||
$etime = trim(shell_exec("ps -p $pid -o etime= | tr -d '\n'"));
|
$etime = shell_exec("ps -p $pid -o etime= | tr -d '\n'");
|
||||||
return ['running' => true, 'pid' => $pid, 'etime' => $etime];
|
return ['running' => true, 'pid' => $pid, 'etime' => $etime];
|
||||||
}
|
}
|
||||||
return ['running' => false, 'pid' => null, 'etime' => null];
|
return ['running' => false, 'pid' => null, 'etime' => null];
|
||||||
|
|||||||
Reference in New Issue
Block a user