aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-02-21 04:11:06 +0000
committerColin Smith <colin@pfsense.org>2005-02-21 04:11:06 +0000
commit593423d000d0694134417c5e8a8de22caa9ec740 (patch)
tree7e8296b924e2dc3a4be71c674d99effc3005e4a7
parent82c8b2589817bdae50cc955a06136d5b4fd3bf7b (diff)
downloadpfsense-packages-593423d000d0694134417c5e8a8de22caa9ec740.tar.gz
pfsense-packages-593423d000d0694134417c5e8a8de22caa9ec740.tar.bz2
pfsense-packages-593423d000d0694134417c5e8a8de22caa9ec740.zip
Update ifstated.
-rw-r--r--packages/ifstated.xml27
1 files changed, 8 insertions, 19 deletions
diff --git a/packages/ifstated.xml b/packages/ifstated.xml
index 24a39e41..cbec3c2f 100644
--- a/packages/ifstated.xml
+++ b/packages/ifstated.xml
@@ -13,9 +13,7 @@
<modify_system>
<item>
<modifyfilename>/etc/sysctl.conf</modifyfilename>
- <textneeded>
- net.inet.carp.preempt=1
- </textneeded>
+ <textneeded>net.inet.carp.preempt=1</textneeded>
</item>
</modify_system>
<fields>
@@ -73,25 +71,16 @@
$fout = fopen("/usr/local/etc/ifstated.conf","w");
if($config['installedpackages']['ifstated']['config'] != "") {
fwrite($fout, "init-state " . $_POST['initstate'] . "\n\n");
- fwrite($fout, "carp_up = \"((carp0 link up) and (carp1 link up))\"\ncarp_down = \"((! carp0
- link up) and (! carp1 link up))\"\ncarp_sync = \"((carp0 link up and carp1 link up) or ((!carp0 link up) and (!car
-p1 link up)))\"\n\n");
- fwrite($fout, "net = '( \"ping -q -c 1 -t 1 " . $_POST['exttestip'] . " > /dev/null\" every 10 and \
-"ping -q -c 1 -t 1 " . $_POST['inttestip'] . " > /dev/null\" every 10)'\n\n");
- fwrite($fout, "peer = '( \"ping -q -c 1 -t 1 " . $_POST['pairextip'] . " > /dev/null\" every 10 and
-\" ping -q -c 1 -t 1 " . $_POST['pairintip'] . " > /dev/null\" every 10)'\n\n");
- fwrite($fout, "state auto {\nif \$carp_up {\nset-state primary\n}\nif \$carp_down {\nset-stat
-e backup\n}\n}\n\n");
- fwrite($fout, "state primary {\ninit {\nrun \"ifconfig carp0 advskew 10\"\nrun \"ifconfig c
-arp1 advskew 10\"\n}\nif ! \$net {\nset-state demoted\n}\n}\n\nstate demoted {\ninit {\nrun \"ifconfig carp0 advskew 2
-54\"\nrun \"ifconfig carp1 advskew 254\"\n}\nif \$net {\nset-state primary\n}\n}\n\n");
- fwrite($fout, "state backup {\ninit {\nrun \"ifconfig carp0 advskew 100\"\nrun \"ifconfig
- carp1 advskew 100\"\n}\nif ! \$carp_sync and \$net and \"sleep 5\" every 10 {\nif(! \$carp_sync) and \$net {\nset-stat
-e promoted\n}\n}\n}\n\nstate promoted {\ninit {\nrun \"ifconfig carp0 advskew 0\"\nrun \"ifconfig carp1 advskew 0\"\n}\nif \$peer or ! \$net {\nset-state backup\n}\n}");
+ fwrite($fout, "carp_up = \"((carp0 link up) and (carp1 link up))\"\ncarp_down = \"((! carp0 link up) and (! carp1 link up))\"\ncarp_sync= \"((carp0 link up and carp1 link up) or ((!carp0 link up) and (!carp1 link up)))\"\n\n");
+ fwrite($fout, "net = '( \"ping -q -c 1 -t 1 " . $_POST['exttestip'] . " > /dev/null\" every 10 and \"ping -q -c 1 -t 1 " . $_POST['inttestip'] . " > /dev/null\" every 10)'\n\n");
+ fwrite($fout, "peer = '( \"ping -q -c 1 -t 1 " . $_POST['pairextip'] . " > /dev/null\" every 10 and \"ping -q -c 1 -t 1 " . $_POST['pairintip'] . " > /dev/null\" every 10)'\n\n");
+ fwrite($fout, "state auto {\nif \$carp_up {\nset-state primary\n}\nif \$carp_down {\nset-state backup\n}\n}\n\n");
+ fwrite($fout, "state primary {\ninit {\nrun \"ifconfig carp0 advskew 10\"\nrun \"ifconfig carp1 advskew 10\"\n}\nif ! \$net {\nset-state demoted\n}\n}\n\nstate demoted {\ninit {\nrun \"ifconfig carp0 advskew 254\"\nrun \"ifconfig carp1 advskew 254\"\n}\nif \$net {\nset-state primary\n}\n}\n\n");
+ fwrite($fout, "state promoted {\ninit {\nrun \"ifconfig carp0 advskew 0\"\nrun \"ifconfig carp1 advskew 0\"\n}\nif \$peer or ! \$net {\nset-state backup\n}\n}\n\n");
+ fwrite($fout, "state backup {\ninit {\nrun \"ifconfig carp0 advskew 100\"\nrun \"ifconfig carp1 advskew 100\"\n}\nif ! \$carp_sync and \$net and \"sleep 5\" every 10 {\nif (! \$carp_sync) and \$net {\nset-state promoted\n}\n}\n}\n");
}
fclose($fout);
mwexec("/usr/bin/killall -HUP ifstated");
-
</custom_add_php_command>
</packagegui>