aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-10-27 15:51:17 +0000
committerJohn Crispin <blogic@openwrt.org>2014-10-27 15:51:17 +0000
commitedeaa79757ac79c2ccdc0bf7ff566b22ffa608ac (patch)
treef6b352c2be97a2ed136aa0697ac909a279960aec /package
parentc1baa9448dfc69b29160293c989151b01590f838 (diff)
downloadupstream-edeaa79757ac79c2ccdc0bf7ff566b22ffa608ac.tar.gz
upstream-edeaa79757ac79c2ccdc0bf7ff566b22ffa608ac.tar.bz2
upstream-edeaa79757ac79c2ccdc0bf7ff566b22ffa608ac.zip
base-files: config_generate did not handle setups with more than 1 switch properly
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43088 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-xpackage/base-files/files/bin/config_generate9
1 files changed, 4 insertions, 5 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 9a3b30065d..7bec566f3f 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -102,8 +102,6 @@ generate_switch() {
json_select $key
json_get_vars enable reset blinkrate cpu_port
- [ -n "$cpu_port" ] || return
-
uci -q batch <<EOF
add network switch
set network.@switch[-1].name='$key'
@@ -111,9 +109,10 @@ set network.@switch[-1].reset='$reset'
set network.@switch[-1].enable_vlan='$enable'
set network.@switch[-1].blinkrate='$blinkrate'
EOF
-
- json_get_keys vlans vlans
- for vlan in $vlans; do generate_switch_vlan $1 $vlan $cpu_port; done
+ [ -n "$cpu_port" ] && {
+ json_get_keys vlans vlans
+ for vlan in $vlans; do generate_switch_vlan $1 $vlan $cpu_port; done
+ }
json_select ..
json_select ..
}