source: trunk/target/linux/brcm47xx/base-files/etc/init.d/wmacfixup @ 21945

Last change on this file since 21945 was 21945, checked in by nbd, 6 years ago

add back the base-files/image code from brcm-2.4 to brcm47xx

  • Property svn:executable set to *
File size: 562 bytes
Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2010 OpenWrt.org
3
4START=41
5
6boot() {
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
32start() { :; }
33stop()  { :; }
Note: See TracBrowser for help on using the repository browser.