diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-01-17 23:31:02 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-01-17 23:31:02 +0000 |
commit | 3c42e475df758ab386d106c2cc6e3dce04d12d3b (patch) | |
tree | dbfae922ce5ef326ddc7f8d3a264f4ca9bb96208 /packages | |
parent | f6a8dee7288a07c646fa5d729e82b1d9ab7d0209 (diff) | |
download | pfsense-packages-3c42e475df758ab386d106c2cc6e3dce04d12d3b.tar.gz pfsense-packages-3c42e475df758ab386d106c2cc6e3dce04d12d3b.tar.bz2 pfsense-packages-3c42e475df758ab386d106c2cc6e3dce04d12d3b.zip |
Forgot the closing brace
Diffstat (limited to 'packages')
-rw-r--r-- | packages/carp.xml | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/packages/carp.xml b/packages/carp.xml index 644845f7..2d0691ad 100644 --- a/packages/carp.xml +++ b/packages/carp.xml @@ -193,46 +193,47 @@ </fields> <custom_php_command_before_form> function sync_package() { - /* - * XXX: find out how many carp and pfsync interfaces are established - * and destroy/down them before sweeping through the list - */ - $fout = fopen("/usr/local/etc/rc.d/carp.sh","w"); - fwrite($fout, "#!/bin/sh \n"); - global $config; - $using_arp_balance = 0; - $using_preempt = 0; - $carp_instances_counter = 0; - $pfsync_instances_counter = 0; - if($config['installedpackages']['carp']['config'] != "") { - foreach($config['installedpackages']['carp']['config'] as $carp) { - $pfsync = 0; - /* - * create the carp interface - */ - system("/sbin/ifconfig carp" . $carp_instances_counter . " create"); - $broadcast_address = gen_subnet_max($carp['ipaddress'], $carp['netmask']); - $carp_command = "/sbin/ifconfig carp" . $carp_instances_counter . " " . $carp['ipaddress'] . " " . $carp['netmask'] . " broadcast " . $broadcast_address . " vhid " . $carp['vhid'] . $carp['advskew '] . " pass " . $carp['password']; - if($carp['balancing'] == "true") $using_arp_balance = 1; - if($carp['preempt'] == "true") $using_preempt = 1; - fwrite($fout, $carp_command . "\n"); - if($carp['pfsync'] != "") $pfsync = 1; - if($pfsync != 0) { + /* + * XXX: find out how many carp and pfsync interfaces are established + * and destroy/down them before sweeping through the list + */ + $fout = fopen("/usr/local/etc/rc.d/carp.sh","w"); + fwrite($fout, "#!/bin/sh \n"); + global $config; + $using_arp_balance = 0; + $using_preempt = 0; + $carp_instances_counter = 0; + $pfsync_instances_counter = 0; + if($config['installedpackages']['carp']['config'] != "") { + foreach($config['installedpackages']['carp']['config'] as $carp) { + $pfsync = 0; /* - * user has selected pfsync, bring it up. + * create the carp interface */ - fwrite($fout, "/sbin/ifconfig pfsync" . $pfsync_instances_counter . " create \n"); - fwrite($fout, "/sbin/ifconfig pfsync" . $pfsync_instances_counter . " up syncif " . $carp['synciface'] . "\n"); - $pfsync_instances_counter++; + system("/sbin/ifconfig carp" . $carp_instances_counter . " create"); + $broadcast_address = gen_subnet_max($carp['ipaddress'], $carp['netmask']); + $carp_command = "/sbin/ifconfig carp" . $carp_instances_counter . " " . $carp['ipaddress'] . " " . $carp['netmask'] . " broadcast " . $broadcast_address . " vhid " . $carp['vhid'] . $carp['advskew '] . " pass " . $carp['password']; + if($carp['balancing'] == "true") $using_arp_balance = 1; + if($carp['preempt'] == "true") $using_preempt = 1; + fwrite($fout, $carp_command . "\n"); + if($carp['pfsync'] != "") $pfsync = 1; + if($pfsync != 0) { + /* + * user has selected pfsync, bring it up. + */ + fwrite($fout, "/sbin/ifconfig pfsync" . $pfsync_instances_counter . " create \n"); + fwrite($fout, "/sbin/ifconfig pfsync" . $pfsync_instances_counter . " up syncif " . $carp['synciface'] . "\n"); + $pfsync_instances_counter++; + } + $carp_instances_counter++; } - $carp_instances_counter++; } + fclose($fout); + system("chmod a+x /usr/local/etc/rc.d/carp.sh"); + system("/usr/local/etc/rc.d/carp.sh"); + if($using_arp_balance == 1) system("sysctl net.inet.arpbalance=1"); + if($preempt == 1) system("sysctl net.inet.carp.preempt=1"); } - fclose($fout); - system("chmod a+x /usr/local/etc/rc.d/carp.sh"); - system("/usr/local/etc/rc.d/carp.sh"); - if($using_arp_balance == 1) system("sysctl net.inet.arpbalance=1"); - if($preempt == 1) system("sysctl net.inet.carp.preempt=1"); sync_package(); </custom_php_command_before_form> <custom_php_resync_config_command> |