Revision 7ebb7114
Added by Colin Smith over 20 years ago
etc/inc/pfsense-utils.inc | ||
---|---|---|
680 | 680 |
* if the service is running returns 1. |
681 | 681 |
*/ |
682 | 682 |
function is_service_running($service_name) { |
683 |
$status = `/bin/ps ax | grep {$service_name}`; |
|
683 |
$status = `/bin/ps ax | grep {$service_name} | grep -v grep`;
|
|
684 | 684 |
$status_split = split("\n", $service_name); |
685 | 685 |
$counter = 0; |
686 | 686 |
foreach ($status_split as $ss) $counter++; |
687 |
if($counter > 1) return 1;
|
|
687 |
if($counter > 0) return 1;
|
|
688 | 688 |
return 0; |
689 | 689 |
} |
690 | 690 |
?> |
Also available in: Unified diff
Add `grep -v grep` to is_service_running() and change threshold to >0.