From 5b67f7acd5a63167ada8d7cbae841310473bee04 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 30 May 2006 19:50:36 +0000 Subject: [PATCH] MFC 12461 "\t0\n" > 0, therefore is_process_running always returned 1. Btw, now it returns true or false, cause I don't see how it could be any different. Should just work now. --- etc/inc/service-utils.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index b34d5f17c8..1880bdc190 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -133,9 +133,8 @@ function restart_service($name) { } function is_process_running($process) { - $status = `/bin/ps awux | /usr/bin/grep {$process} | grep -v grep | wc -l`; - if($status > 0) return 1; - return 0; + $running = (trim(shell_exec("ps axwu | grep $process | grep -v grep")) != ''); + return $running; } function is_dhcp_running($interface) {