From 439b0e26bc443b208f5112d348a4621bab25e14e Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 29 Jul 2010 17:10:08 +0000 Subject: Do not write anything to config before finishing all tests of correctnes. This avoids a problem of wrong config to apinger Discovered-by: Seth --- etc/inc/gwlb.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index eda0b06..89eeab9 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -160,11 +160,12 @@ EOD; if (!is_ipaddr($gateway['monitor'])) continue; - $apingercfg .= "target \"{$gateway['monitor']}\" {\n"; - $apingercfg .= " description \"{$gateway['name']}\"\n"; $gwifip = find_interface_ip($gateway['interface']); if (!is_ipaddr($gwifip)) continue; //Skip this target + + $apingercfg .= "target \"{$gateway['monitor']}\" {\n"; + $apingercfg .= " description \"{$gateway['name']}\"\n"; $apingercfg .= " srcip \"{$gwifip}\"\n"; $alarms = ""; $override = false; -- cgit v1.1