summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.inc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2008-03-13 15:37:30 +0000
committerSeth Mos <seth.mos@xs4all.nl>2008-03-13 15:37:30 +0000
commit171b59ba2411872c526151e83efdb53f59c3f6e6 (patch)
tree7a47075c0aca1e6a3e3d7981dc2873409fa95061 /etc/inc/config.inc
parent9f0280d96d0fcaf3aa40d317188e71f73196b389 (diff)
downloadpfsense-171b59ba2411872c526151e83efdb53f59c3f6e6.zip
pfsense-171b59ba2411872c526151e83efdb53f59c3f6e6.tar.gz
Remove duplicate rrd upgrade entry.
Add first attempt at gateway upgrade code.
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r--etc/inc/config.inc28
1 files changed, 21 insertions, 7 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 1138718..84adf01 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -967,13 +967,6 @@ function convert_config() {
$config['version'] = "2.6";
}
- /* Convert 2.6 -> 2.7 */
- if ($config['version'] <= 2.6) {
- $config['interfaces']['wan']['use_rrd_gateway'] = $config['system']['use_rrd_gateway'];
- unset($config['system']['use_rrd_gateway']);
- $config['version'] = "2.7";
- }
-
/* Convert 2.7 -> 2.8 */
if ($config['version'] <= 2.7) {
$founditem = false;
@@ -1154,6 +1147,27 @@ function convert_config() {
$config['version'] = "4.2";
}
+
+ /* Convert 4.2 -> 4.3 */
+ if ($config['version'] <= 4.1) {
+ /* migrate old interface gateway to the new gateways config */
+ $old_gateways = array();
+ $gateways = array();
+ $i = 0;
+ $old_gateways = get_interfaces_with_gateway();
+ foreach($old_gateways as $ifname => $interface) {
+ $config['gateways'][$i][$ifname]['gateway'] = $config['interfaces'][$ifname]['gateway'];
+ $config['gateways'][$i][$ifname]['interface'] = $ifname;
+ $config['gateways'][$i][$ifname]['name'] = $ifname ."-". $config['interfaces'][$ifname]['gateway'];
+ if(is_ipaddr($config['interfaces'][$ifname]['use_rrd_gateway'])) {
+ $config['gateways'][$i][$ifname]['monitor'] = $config['interfaces'][$ifname]['use_rrd_gateway'];
+ unset($config['interfaces'][$ifname]['use_rrd_gateway']);
+ }
+ $config['interfaces'][$ifname]['gateway'] = $config['gateways'][$i][$ifname]['name'];
+ $i++;
+ }
+ }
+
if ($prev_version != $config['version'])
write_config("Upgraded config version level from {$prev_version} to {$config['version']}");
}
OpenPOWER on IntegriCloud