Revision 1ab56363
Added by Ermal Luçi over 16 years ago
- 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.
etc/inc/util.inc | ||
---|---|---|
42 | 42 |
|
43 | 43 |
function isvalidproc($proc) { |
44 | 44 |
$running = `ps awux | grep $proc | grep -v grep | wc -l`; |
45 |
if(intval($running) > 1) |
|
45 |
if(intval($running) >= 1)
|
|
46 | 46 |
return true; |
47 | 47 |
else |
48 | 48 |
return false; |
... | ... | |
71 | 71 |
mwexec("/usr/bin/killall " . escapeshellarg($procname)); |
72 | 72 |
} |
73 | 73 |
|
74 |
function is_module_loaded($module_name) { |
|
75 |
$running = `/sbin/kldstat -n {$module_name} | /usr/bin/grep {$module_name} | /usr/bin/wc -l`; |
|
76 |
if (intval($running) >= 1) |
|
77 |
return true; |
|
78 |
else |
|
79 |
return false; |
|
80 |
} |
|
81 |
|
|
74 | 82 |
/* return the subnet address given a host address and a subnet bit count */ |
75 | 83 |
function gen_subnet($ipaddr, $bits) { |
76 | 84 |
if (!is_ipaddr($ipaddr) || !is_numeric($bits)) |
Also available in: Unified diff