diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2016-02-24 13:07:33 -0600 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2016-02-24 13:08:23 -0600 |
commit | 67c6bab59d92a0e6f30f7f8c9d6bbaa6ce21dd75 (patch) | |
tree | d9c67885890ef7056c3a1fadc7072e4203808c1a /src/etc/inc/upgrade_config.inc | |
parent | af7698018fe8093c25931b75a3798f197bf87d1c (diff) | |
download | pfsense-67c6bab59d92a0e6f30f7f8c9d6bbaa6ce21dd75.zip pfsense-67c6bab59d92a0e6f30f7f8c9d6bbaa6ce21dd75.tar.gz |
Add the upgrade code for OpenBGPd and Quagga OSPF packages.
Ticket #5884
Diffstat (limited to 'src/etc/inc/upgrade_config.inc')
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index 403bc55..c96e4c4 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -4658,4 +4658,58 @@ function upgrade_145_to_146() { exec("cd /; LANG=C NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='{$g['cf_conf_path']}' /etc/rc.backup_rrd.sh"); } +function upgrade_bgpd_146_to_147() { + global $config; + + if (!isset($config['installedpackages']['openbgpd']['config']) || + !is_array($config['installedpackages']['openbgpd']['config'])) { + return; + } + $openbgpd_conf = &$config['installedpackages']['openbgpd']['config'][0]; + if (!isset($openbgpd_conf['carpstatusip']) && + !is_ipaddr($openbgpd_conf['carpstatusip'])) { + return; + } + + if (!is_array($config['virtualip']['vip'])) + return; + foreach ($config['virtualip']['vip'] as $idx => $vip) { + if ($vip['subnet'] == $openbgpd_conf['carpstatusip']) { + $openbgpd_conf['carpstatusvid'] = "_vip{$vip['uniqid']}"; + unset($openbgpd_conf['carpstatusip']); + return; + } + } +} + +function upgrade_quagga_146_to_147() { + global $config; + + if (!isset($config['installedpackages']['quaggaospfd']['config']) || + !is_array($config['installedpackages']['quaggaospfd']['config'])) { + return; + } + $ospfd_conf = &$config['installedpackages']['quaggaospfd']['config'][0]; + if (!isset($ospfd_conf['carpstatusip']) && + !is_ipaddr($ospfd_conf['carpstatusip'])) { + return; + } + + if (!is_array($config['virtualip']['vip'])) + return; + foreach ($config['virtualip']['vip'] as $idx => $vip) { + if ($vip['subnet'] == $ospfd_conf['carpstatusip']) { + $ospfd_conf['carpstatusvid'] = "_vip{$vip['uniqid']}"; + unset($ospfd_conf['carpstatusip']); + return; + } + } +} + +function upgrade_146_to_147() { + + upgrade_bgpd_146_to_147(); + upgrade_quagga_146_to_147(); +} + ?> |