diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-03-09 21:02:54 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-03-09 21:02:54 +0000 |
commit | 44dc32e40f43041cb0441fcd1f1f9eb485b3c010 (patch) | |
tree | 03feffb8b426119551f6191b9a8f83fe2d11b56e /etc | |
parent | 54f4caedeec3efc548999f5fac9672bbce3b7cf9 (diff) | |
download | pfsense-44dc32e40f43041cb0441fcd1f1f9eb485b3c010.zip pfsense-44dc32e40f43041cb0441fcd1f1f9eb485b3c010.tar.gz |
Add is_service_running()
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index e5692b5..7726b49 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -632,4 +632,18 @@ function gather_altq_queue_stats($dont_return_root_queues) { return $queue_stats; } +/* + * is_service_running($service_name): checks to see if a service is running. + * if the service is running returns 1. + */ +function is_service_running($service_name) { + $status = `/bin/ps ax | grep {$service_name}`; + $status_split = split("\n", $service_name); + $counter = 0; + foreach ($status_split as $ss) $counter++ + if($counter > 1) return 1; + return 0; + +} + ?> |