aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-02-07 14:18:43 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-02-07 14:18:43 +0000
commitaa5e88de406c9aaa1b2b37d81c503c56fbf79f09 (patch)
treeeb630b46641a1593a53c570f481d91de517b2c74
parentbe866cf5ddc32c1c0d69dbc14662fb04a5cab8ed (diff)
downloadmaster-187ad058-aa5e88de406c9aaa1b2b37d81c503c56fbf79f09.tar.gz
master-187ad058-aa5e88de406c9aaa1b2b37d81c503c56fbf79f09.tar.bz2
master-187ad058-aa5e88de406c9aaa1b2b37d81c503c56fbf79f09.zip
base-files: set mac address in default network config via device sections
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48646 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xpackage/base-files/files/bin/config_generate8
1 files changed, 7 insertions, 1 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 9218788b5e..92eb14bb11 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -77,7 +77,13 @@ generate_network() {
set network.$1.type='$type'
set network.$1.ifname='$ifname'
set network.$1.proto='none'
- set network.$1.macaddr='$macaddr'
+ EOF
+
+ [ -n "$macaddr" ] && uci -q batch <<-EOF
+ delete network.$1_dev
+ set network.$1_dev='device'
+ set network.$1_dev.name='$ifname'
+ set network.$1_dev.macaddr='$macaddr'
EOF
case "$protocol" in