[brcm47xx] fix the default network configuration for the ASUS WL-330gE (#8751)
[openwrt.git] / target / linux / brcm47xx / base-files / etc / init.d / wmacfixup
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2010 OpenWrt.org
3
4 START=41
5
6 boot() {
7 [ -d /sys/class/ieee80211 ] || exit
8
9 commit=0
10
11 fixup_wmac() {
12 local cfg="$1"
13 local cfmac
14
15 config_get cfmac "$cfg" macaddr
16
17 [ "$cfmac" != "00:90:4c:5f:00:2a" ] || {
18 local nvmac="$(nvram get il0macaddr 2>/dev/null)"
19 [ -n "$nvmac" ] && [ "$nvmac != "$cfmac ] && {
20 uci set wireless.$cfg.macaddr="$nvmac"
21 commit=1
22 }
23 }
24 }
25
26 config_load wireless
27 config_foreach fixup_wmac wifi-device
28
29 [ "$commit" = 1 ] && uci commit wireless
30 }
31
32 start() { :; }
33 stop() { :; }
This page took 0.045202 seconds and 5 git commands to generate.