summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-04-26 13:47:33 +0000
committerErmal Luçi <eri@pfsense.org>2009-04-26 13:47:33 +0000
commit6dc3a5c2e428a6f8c0d11d904f12ab8ab86a8718 (patch)
treef528b84d1cd3ee104d92a2320a9eabf77bc8c9eb /etc/inc/util.inc
parent52947718175a67512a7b79c5d401f2ba7d536489 (diff)
downloadpfsense-6dc3a5c2e428a6f8c0d11d904f12ab8ab86a8718.zip
pfsense-6dc3a5c2e428a6f8c0d11d904f12ab8ab86a8718.tar.gz
* Move other functions around to where it makes sense.
* Reduce somewhat require_once() overhead by removing the includes from gwlb.inc they are not needed. Some more analysis is needed on the include path
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 7c31ca5..b1d875e 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -40,9 +40,15 @@ function isvalidpid($pid) {
return false;
}
+function is_process_running($process) {
+ $running = (trim(shell_exec("ps axwu | grep '\b{$process}\b' | grep -v 'grep'")) != '');
+
+ return $running;
+}
+
function isvalidproc($proc) {
- $running = `ps awux | grep $proc | grep -v grep | wc -l`;
- if(intval($running) >= 1)
+ $running = is_process_running($proc);
+ if (intval($running) >= 1)
return true;
else
return false;
OpenPOWER on IntegriCloud