diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/carp.xml | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/packages/carp.xml b/packages/carp.xml index 1b9682ed..6c562170 100644 --- a/packages/carp.xml +++ b/packages/carp.xml @@ -222,6 +222,22 @@ 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"); + $pfsync_instances_counter++; + } + } if($config['installedpackages']['carp']['config'] != "") { foreach($config['installedpackages']['carp']['config'] as $carp) { /* @@ -240,22 +256,6 @@ $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"); - $pfsync_instances_counter++; - } - } fclose($fout); chmod("/usr/local/pkg/pf/carp.sh", 0755); mwexec("/usr/local/pkg/pf/carp.sh"); |