summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
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