aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/bin/config_generate19
1 files changed, 8 insertions, 11 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index d895090309..0dca5549e8 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -133,6 +133,14 @@ generate_network() {
type=""
}
+ if [ -n "$macaddr" ]; then
+ uci -q batch <<-EOF
+ add network device
+ set network.@device[-1].name='$device'
+ set network.@device[-1].macaddr='$macaddr'
+ EOF
+ fi
+
uci -q batch <<-EOF
delete network.$1
set network.$1='interface'
@@ -141,17 +149,6 @@ generate_network() {
set network.$1.proto='none'
EOF
- if [ -n "$macaddr" ]; then
- for name in $device; do
- uci -q batch <<-EOF
- delete network.$1_${name/./_}_dev
- set network.$1_${name/./_}_dev='device'
- set network.$1_${name/./_}_dev.name='$name'
- set network.$1_${name/./_}_dev.macaddr='$macaddr'
- EOF
- done
- fi
-
case "$protocol" in
static)
local ipad