diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-02-17 19:38:19 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-02-17 19:38:19 +0000 |
commit | a8ac6c98567d94c1857b71dfec4ed8508dbf5f0f (patch) | |
tree | a58e37eb1196f4fa83ff13f4bfb1d2dbb520280e /etc/inc/pfsense-utils.inc | |
parent | c4967f1ce5ffea4791ba9825c260380758ce3e12 (diff) | |
download | pfsense-a8ac6c98567d94c1857b71dfec4ed8508dbf5f0f.zip pfsense-a8ac6c98567d94c1857b71dfec4ed8508dbf5f0f.tar.gz |
move is_carp_defined to helper file, convert function to use true/false instead of 0 or 1
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 22 |
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 |