mediatek: set persistent wifi mac for bpi-r64 and bpi-r3
[openwrt/staging/dedeckeh.git] / target / linux / mediatek / filogic / base-files / etc / hotplug.d / ieee80211 / 11_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 bananapi,bpi-r3)
14 addr=$(macaddr_add $(cat /sys/class/net/eth0/address) 2)
15 [ "$PHYNBR" = "0" ] && macaddr_unsetbit $addr 6 > /sys${DEVPATH}/macaddress
16 [ "$PHYNBR" = "1" ] && macaddr_setbit $addr 6 > /sys${DEVPATH}/macaddress
17 ;;
18 esac