summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r--etc/inc/pfsense-utils.inc22
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 73ecc3b..6ebe247 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -67,4 +67,26 @@ function return_filename_as_string($filename) {
return $tmp;
}
+/*
+ * is_carp_defined: returns true if carp is detected in kernel
+ */
+function is_carp_defined() {
+ /* is carp compiled into the kernel and userland? */
+ $command = "/sbin/sysctl -a | grep carp";
+ $fd = popen($command . " 2>&1 ", "r");
+ if(!$fd) {
+ log_error("Warning, could not execute command ");
+ return 0;
+ }
+ while(!feof($fd)) {
+ $tmp .= fread($fd,49);
+ }
+ fclose($fd);
+
+ if($tmp == "")
+ return false;
+ else
+ return true;
+}
+
?> \ No newline at end of file
OpenPOWER on IntegriCloud