summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-08-05 17:00:36 +0000
committerErmal Luçi <eri@pfsense.org>2008-08-05 17:00:36 +0000
commit0760c14afb80ab84e8a372de6d9150a9f66461be (patch)
tree9991eb0c77fcf29e9f64f8c8fdccdfbcdc386f7c /etc
parent675aac3d62d50fd00f9012ceff0ffe2b63a155f1 (diff)
downloadpfsense-0760c14afb80ab84e8a372de6d9150a9f66461be.zip
pfsense-0760c14afb80ab84e8a372de6d9150a9f66461be.tar.gz
Try to convert old bridges config to the new format.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/config.inc25
1 files changed, 22 insertions, 3 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 59041ca..9f5c1c1 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -1668,9 +1668,28 @@ function convert_config() {
unset($config['bridge']);
- foreach ($config['interfaces'] as &$intf) {
- if (isset($intf['bridge']))
- unset($intf['bridge']);
+ $convert_bridges = false;
+ foreach($config['interfaces'] as $intf) {
+ if (isset($intf['bridge']) && $intf['bridge'] <> "") {
+ $config['bridges'] = array();
+ $config['bridges']['bridge'] = array();
+ $convert_bridges = true;
+ break;
+ }
+ }
+ if ($convert_bridges == true) {
+ $i = 0;
+ foreach ($config['interfaces'] as $ifr => &$intf) {
+ if (isset($intf['bridge']) && $intf['bridge'] <> "") {
+ $nbridge = array();
+ $nbridge['members'] = "{$ifr},{$intf['bridge']}";
+ $nbridge['descr'] = "Converted bridged {$ifr}";
+ $nbridge['bridgeif'] = "bridge{$i}";
+ $config['bridges']['bridge'][] = $nbridge;
+ unset($intf['bridge']);
+ $i++;
+ }
+ }
}
}
OpenPOWER on IntegriCloud