summaryrefslogtreecommitdiff
path: root/package/base-files
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
commitf70c8ba1980585e3f80499bba5a043e0b4940e4b (patch)
treef534e1896cd4e9bcfed5844d4a1e48c8ca7547c7 /package/base-files
parent32dea5d2a93ed1efa10052746fb932b3a2d67770 (diff)
downloadmtk-20170518-f70c8ba1980585e3f80499bba5a043e0b4940e4b.zip
mtk-20170518-f70c8ba1980585e3f80499bba5a043e0b4940e4b.tar.gz
mtk-20170518-f70c8ba1980585e3f80499bba5a043e0b4940e4b.tar.bz2
base-files: set mac address in default network config via device sections
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48646
Diffstat (limited to 'package/base-files')
-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 9218788..92eb14b 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