mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add is_service_running()
This commit is contained in:
parent
54f4caedee
commit
44dc32e40f
@ -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;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user