Update system_services.php

This commit is contained in:
FusionPBX
2025-10-25 02:07:07 -06:00
committed by GitHub
parent 1221ac6498
commit 82ab719507

View File

@@ -57,9 +57,9 @@
if (!function_exists('is_running')) {
function is_running(string $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)) {
$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' => false, 'pid' => null, 'etime' => null];