diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/carp.xml | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/packages/carp.xml b/packages/carp.xml index cdf7d11a..13e3b752 100644 --- a/packages/carp.xml +++ b/packages/carp.xml @@ -222,24 +222,8 @@ global $config; $carp_instances_counter = 0; $pfsync_instances_counter = 0; - if($config['installedpackages']['carpsettings']['config'] != "") - foreach($config['installedpackages']['carpsettings']['config'] as $carp) - if($carp['pfsyncenabled'] != "") { - $pfsync = 1; - if($carp['premption'] != "") - fwrite($fout, "/sbin/sysctl net.inet.carp.preempt=1\n"); - if($carp['balancing'] != "") - fwrite($fout, "/sbin/sysctl net.inet.arpbalance=1\n"); - $carp_sync_int = convert_friendly_interface_to_real_interface_name($carp['pfsyncinterface']); - fwrite($fout, "/sbin/ifconfig pfsync0 create\n"); - fwrite($fout, "/sbin/ifconfig pfsync0 syncdev " . $carp_sync_int . "\n"); - fwrite($fout, "/sbin/ifconfig {$carp_sync_int} up\n"); - fwrite($fout, "/sbin/ifconfig pfsync0 up\n"); - fwrite($fout, "sleep 10\n"); - $pfsync_instances_counter++; - } if($config['installedpackages']['carp']['config'] != "") { - foreach($config['installedpackages']['carp']['config'] as $carp) { + foreach($config['installedpackages']['carp']['config'] as $carp) { /* * create the carp interface */ @@ -254,9 +238,25 @@ fwrite($fout, $carp_command . "\n"); fwrite($fout, "/sbin/ifconfig carp{$carp_instances_counter} up\n"); $carp_instances_counter++; - } - } - + } + } + if($config['installedpackages']['carpsettings']['config'] != "") { + foreach($config['installedpackages']['carpsettings']['config'] as $carp) + if($carp['pfsyncenabled'] != "") { + $pfsync = 1; + if($carp['premption'] != "") + fwrite($fout, "/sbin/sysctl net.inet.carp.preempt=1\n"); + if($carp['balancing'] != "") + fwrite($fout, "/sbin/sysctl net.inet.arpbalance=1\n"); + $carp_sync_int = convert_friendly_interface_to_real_interface_name($carp['pfsyncinterface']); + fwrite($fout, "/sbin/ifconfig pfsync0 create\n"); + fwrite($fout, "/sbin/ifconfig pfsync0 syncdev " . $carp_sync_int . "\n"); + fwrite($fout, "/sbin/ifconfig {$carp_sync_int} up\n"); + fwrite($fout, "/sbin/ifconfig pfsync0 up\n"); + fwrite($fout, "sleep 10\n"); + $pfsync_instances_counter++; + } + } fclose($fout); chmod("/usr/local/pkg/pf/carp.sh", 0755); mwexec("/usr/local/pkg/pf/carp.sh"); |