aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/config_generate
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/bin/config_generate')
-rwxr-xr-xpackage/base-files/files/bin/config_generate10
1 files changed, 9 insertions, 1 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 0dca5549e8..b3752c5430 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -114,9 +114,17 @@ generate_network() {
add network device
set network.@device[-1].name='br-$1'
set network.@device[-1].type='bridge'
- set network.@device[-1].macaddr='$macaddr'
EOF
for port in $ports; do uci add_list network.@device[-1].ports="$port"; done
+ [ -n "macaddr" ] && {
+ for port in $ports; do
+ uci -q batch <<-EOF
+ add network device
+ set network.@device[-1].name='$port'
+ set network.@device[-1].macaddr='$macaddr'
+ EOF
+ done
+ }
device=br-$1
type=
macaddr=""