summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2012-05-23 16:50:35 -0600
committerErik Fonnesbeck <efonnes@gmail.com>2012-05-23 17:01:38 -0600
commite820da2a9318b95336febaf2d4bfb8c370ef985c (patch)
tree16358b05aaa4fc4fe33853d95af8effb94120ca7 /etc/inc
parent79f4bb0b505c2be34a75c768a48760abe3f8d14d (diff)
downloadpfsense-e820da2a9318b95336febaf2d4bfb8c370ef985c.zip
pfsense-e820da2a9318b95336febaf2d4bfb8c370ef985c.tar.gz
Fix reference updating for when more than one carp vip exists. Skip the upgrade code if no carp vip defined. Ticket #2445
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/upgrade_config.inc14
1 files changed, 9 insertions, 5 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 319fbbd..5821c24 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -2793,17 +2793,21 @@ function upgrade_085_to_086() {
global $config, $g;
/* XXX: Gross hacks in sight */
- write_config();
if (is_array($config['virtualip']['vip'])) {
$vipchg = array();
foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['mode'] != "carp")
continue;
- file_put_contents("{$g['tmp_path']}/vipreplace", "s/\\([^_]\\)vip{$vip['vhid']}\\([^0-9]\\)/\\1{$vip['interface']}_vip{$vip['vhid']}\\2/g\n");
+ $vipchg[] = "s/\\([^_]\\)vip{$vip['vhid']}\\([^0-9]\\)/\\1{$vip['interface']}_vip{$vip['vhid']}\\2/g\n";
+ }
+ if (!empty($vipchg)) {
+ file_put_contents("{$g['tmp_path']}/vipreplace", $vipchg);
+ write_config();
+ mwexec("/usr/bin/sed -I \"\" -f {$g['tmp_path']}/vipreplace /conf/config.xml");
+ require_once("config.lib.inc");
+ $config = parse_config(true);
+ @unlink("{$g['tmp_path']}/vipreplace");
}
- mwexec("/usr/bin/sed -I \"\" -f {$g['tmp_path']}/vipreplace /conf/config.xml");
- require_once("config.lib.inc");
- $config = parse_config(true);
}
}
OpenPOWER on IntegriCloud