diff options
author | Colin Smith <colin@pfsense.org> | 2005-06-22 04:22:28 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-06-22 04:22:28 +0000 |
commit | a93f79c14f05ecab27b21705af17843224534c63 (patch) | |
tree | 236a0a69df5d3f144930f8d9d12e4b0f89365095 /etc | |
parent | ef09107dd4734492f8b5a3b65ce3a827ce36e754 (diff) | |
download | pfsense-a93f79c14f05ecab27b21705af17843224534c63.zip pfsense-a93f79c14f05ecab27b21705af17843224534c63.tar.gz |
Fixes and updates.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/service-utils.inc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 4f636aa..ab2d7ca 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -81,7 +81,7 @@ function start_service($service) { } } -function start_service($service) { +function stop_service($service) { global $config, $g; if($config['installedpackages']['service']) { foreach($config['installedpackages']['service'] as $service) { @@ -125,13 +125,14 @@ function is_service_running($service, $ps = "") { exec("/bin/ps a | awk '{ print $5 }'", $psout); array_shift($psout); foreach($psout as $line) { - $ps[] = array_pop(explode('/', $line)); + $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line))))); } } if($config['installedpackages']['service']) { - foreach($config['installedpackages']['service'] as $service) { - if($service['name'] == $service) { - if(in_array($service['executable'], $ps)) { + foreach($config['installedpackages']['service'] as $aservice) { + if($service == $aservice['name']) { + if(!$aservice['executable']) return false; + if(in_array($aservice['executable'], $ps)) { return true; } else { return false; |