b8f8faee9ca28425355793251e434b7a8bd63ca9
[openwrt/openwrt.git] / target / linux / ramips / mt76x8 / base-files / etc / hotplug.d / ieee80211 / 10_fix_wifi_mac
1 [ "$ACTION" == "add" ] || exit 0
2
3 PHYNBR=${DEVPATH##*/phy}
4
5 [ -n $PHYNBR ] || exit 0
6
7 . /lib/functions.sh
8 . /lib/functions/system.sh
9
10 board=$(board_name)
11
12 case "$board" in
13 hiwifi,hc5661a|\
14 hiwifi,hc5761a|\
15 hiwifi,hc5861b)
16 label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
17 [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
18 echo -n "$label_mac" > /sys${DEVPATH}/macaddress
19 [ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
20 macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
21 ;;
22 esac