diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-10-23 17:36:18 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-10-23 17:36:18 +0000 |
commit | c2b6723a3ad65a7e07d7bc9da4c78f952fba789c (patch) | |
tree | 8a2f8efbbad6f89e9cc322f4d34fd5203592e684 /etc/inc | |
parent | 6518f0a69c521cd9028b3927ced978e462ce5b60 (diff) | |
download | pfsense-c2b6723a3ad65a7e07d7bc9da4c78f952fba789c.zip pfsense-c2b6723a3ad65a7e07d7bc9da4c78f952fba789c.tar.gz |
MFC 7080 7084
Minor cleanup and comment out old $ps code for the time being.
Fix backwards comment.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/service-utils.inc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 2153e09..f5add0c 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -147,27 +147,24 @@ function restart_service_if_running($service) { function is_service_running($service, $ps = "") { global $config; + /* if(!$ps) { exec("/bin/ps ax | awk '{ print $5 }'", $psout); - array_shift($psout); - foreach($psout as $line) { - $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line))))); - } } - if($config['installedpackages']['service']) { + */ + if(is_array($config['installedpackages']['service'])) { foreach($config['installedpackages']['service'] as $aservice) { if(strtolower($service) == strtolower($aservice['name'])) { if(!$aservice['executable']) return false; - if(in_array($aservice['executable'], $ps)) { + /* + if(count(preg_grep("/{$aservice['executable']}/i", $ps))) { return true; } else { return false; } - break; + */ + return is_process_running($aservice['executable']) ? true : false; } } } - if(is_process_running($service)) - return true; - return false; } |