summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-03-08 00:32:22 +0000
committerErmal Luçi <eri@pfsense.org>2009-03-08 00:32:22 +0000
commit1ab56363bbc910157191850b45d78f9ec98e5099 (patch)
tree410010ad8e06b8ff8a045bf9a26e8757f2fb9a96 /etc/inc/util.inc
parent179941d470b52b6d4164a62bf1c146d7ee0e590b (diff)
downloadpfsense-1ab56363bbc910157191850b45d78f9ec98e5099.zip
pfsense-1ab56363bbc910157191850b45d78f9ec98e5099.tar.gz
* Do not restart ipfw-classifyd on every iteration just send a signal to reload the config. This way no data is lost
* Some cleanups to fix warning/spamming of the System logs * Present is_module_loaded() function to check if a module is loaded.
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 3ef01fc..f85a672 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -42,7 +42,7 @@ function isvalidpid($pid) {
function isvalidproc($proc) {
$running = `ps awux | grep $proc | grep -v grep | wc -l`;
- if(intval($running) > 1)
+ if(intval($running) >= 1)
return true;
else
return false;
@@ -71,6 +71,14 @@ function killbyname($procname) {
mwexec("/usr/bin/killall " . escapeshellarg($procname));
}
+function is_module_loaded($module_name) {
+ $running = `/sbin/kldstat -n {$module_name} | /usr/bin/grep {$module_name} | /usr/bin/wc -l`;
+ if (intval($running) >= 1)
+ return true;
+ else
+ return false;
+}
+
/* return the subnet address given a host address and a subnet bit count */
function gen_subnet($ipaddr, $bits) {
if (!is_ipaddr($ipaddr) || !is_numeric($bits))
OpenPOWER on IntegriCloud