diff options
author | jim-p <jimp@pfsense.org> | 2013-02-15 10:04:54 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-02-15 10:17:18 -0500 |
commit | c6e83f5e6d00da3b417a6de1a1963d3117e69918 (patch) | |
tree | 6c4e0fd1f6440ff0512d8b7ccca873543835e342 /etc | |
parent | 508799c3794a9febb9e4abf7167171aa195e77d0 (diff) | |
download | pfsense-c6e83f5e6d00da3b417a6de1a1963d3117e69918.zip pfsense-c6e83f5e6d00da3b417a6de1a1963d3117e69918.tar.gz |
Add php shell scripts to (en|dis)able carp.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/phpshellsessions/disablecarp | 17 | ||||
-rw-r--r-- | etc/phpshellsessions/enablecarp | 22 |
2 files changed, 39 insertions, 0 deletions
diff --git a/etc/phpshellsessions/disablecarp b/etc/phpshellsessions/disablecarp new file mode 100644 index 0000000..5868158 --- /dev/null +++ b/etc/phpshellsessions/disablecarp @@ -0,0 +1,17 @@ +! echo "Disabling CARP..." +require_once("config.inc"); +require_once("interfaces.inc"); +require_once("util.inc"); + +mwexec("/sbin/sysctl net.inet.carp.allow=0"); +if(is_array($config['virtualip']['vip'])) { + $viparr = &$config['virtualip']['vip']; + foreach ($viparr as $vip) { + switch ($vip['mode']) { + case "carp": + interface_vip_bring_down($vip); + sleep(1); + break; + } + } +} diff --git a/etc/phpshellsessions/enablecarp b/etc/phpshellsessions/enablecarp new file mode 100644 index 0000000..b10e15e --- /dev/null +++ b/etc/phpshellsessions/enablecarp @@ -0,0 +1,22 @@ +! echo "Enabling CARP..." +require_once("config.inc"); +require_once("interfaces.inc"); +require_once("util.inc"); + +if(is_array($config['virtualip']['vip'])) { + $viparr = &$config['virtualip']['vip']; + foreach ($viparr as $vip) { + switch ($vip['mode']) { + case "carp": + interface_carp_configure($vip); + sleep(1); + break; + case "ipalias": + if (strstr($vip['interface'], "_vip")) + interface_ipalias_configure($vip); + break; + } + } +} +interfaces_carp_setup(); +mwexec("/sbin/sysctl net.inet.carp.allow=1"); |