aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2020-11-19 15:08:33 +0100
committerJohn Crispin <john@phrozen.org>2020-11-19 15:38:37 +0100
commit8134c542e2e41d1156efe2a43d81304554a90540 (patch)
treeb40d88adc12dff917641a224f0f8fbfab379c384 /package/base-files/files
parentf276395cda79996d395209700a51bb94a0e25abd (diff)
downloadupstream-8134c542e2e41d1156efe2a43d81304554a90540.tar.gz
upstream-8134c542e2e41d1156efe2a43d81304554a90540.tar.bz2
upstream-8134c542e2e41d1156efe2a43d81304554a90540.zip
base-files: generated named bridge-vlan sections
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/bin/config_generate15
1 files changed, 8 insertions, 7 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index e23f901504..79386d41b5 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -18,14 +18,15 @@ generate_bridge() {
bridge_vlan_id=0
generate_bridge_vlan() {
- local device=$1
- local ports="$2"
+ local name=$1_vlan
+ local device=$2
+ local ports="$3"
bridge_vlan_id=$((bridge_vlan_id + 1))
uci -q batch <<-EOF
- add network bridge-vlan
- set network.@bridge-vlan[-1].device='$device'
- set network.@bridge-vlan[-1].vlan='$bridge_vlan_id'
- set network.@bridge-vlan[-1].ports='$ports'
+ set network.$name=bridge-vlan
+ set network.$name.device='$device'
+ set network.$name.vlan='$bridge_vlan_id'
+ set network.$name.ports='$ports'
EOF
}
@@ -101,7 +102,7 @@ generate_network() {
esac
[ -n "$bridge" ] && {
- generate_bridge_vlan $bridge "$ifname"
+ generate_bridge_vlan $1 $bridge "$ifname"
ifname=$bridge.$bridge_vlan_id
type=""
}