From 5f838ec30ffbe2531c4cd61cbefa05f1c9826cac Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 11 Mar 2005 23:19:05 +0000 Subject: Do not foreach carpsettings if the user has not visited the carp settings tab. --- packages/carp.xml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/carp.xml b/packages/carp.xml index 453f21fb..5b53ddfe 100644 --- a/packages/carp.xml +++ b/packages/carp.xml @@ -231,21 +231,22 @@ $carp_instances_counter++; } } - foreach($config['installedpackages']['carpsettings']['config'] as $carp) - if($carp['pfsyncenabled'] != "") { - $pfsync = 1; - if($carp['premption'] != "") - $preempt = 1; - if($carp['balancing'] != "") - $using_arp_balance = 1; - $carp_sync_int = convert_friendly_interface_to_real_interface_name($carp['pfsyncinterface']); - $carp_sync_ip = $carp['pfsyncip']; - fwrite($fout, "/sbin/ifconfig pfsync0 create\n"); - fwrite($fout, "/sbin/ifconfig pfsync0 {$carp_sync_ip}/24\n"); - fwrite($fout, "/sbin/ifconfig pfsync0 syncif " . $carp_sync_int . "\n"); - fwrite($fout, "/sbin/ifconfig pfsync0 up\n"); - $pfsync_instances_counter++; - } + if($config['installedpackages']['carpsettings']['config'] != "") + foreach($config['installedpackages']['carpsettings']['config'] as $carp) + if($carp['pfsyncenabled'] != "") { + $pfsync = 1; + if($carp['premption'] != "") + $preempt = 1; + if($carp['balancing'] != "") + $using_arp_balance = 1; + $carp_sync_int = convert_friendly_interface_to_real_interface_name($carp['pfsyncinterface']); + $carp_sync_ip = $carp['pfsyncip']; + fwrite($fout, "/sbin/ifconfig pfsync0 create\n"); + fwrite($fout, "/sbin/ifconfig pfsync0 {$carp_sync_ip}/24\n"); + fwrite($fout, "/sbin/ifconfig pfsync0 syncif " . $carp_sync_int . "\n"); + fwrite($fout, "/sbin/ifconfig pfsync0 up\n"); + $pfsync_instances_counter++; + } fwrite($fout, "/etc/rc.filter_configure"); fclose($fout); mwexec("chmod a+x /usr/local/etc/rc.d/carp.sh"); -- cgit v1.2.3