Add is_service_running()

This commit is contained in:
Scott Ullrich 2005-03-09 21:02:54 +00:00
parent 54f4caedee
commit 44dc32e40f

View File

@ -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;
}
?>