ipq806x: Sort occurrences of boardame alphabetically
[openwrt/staging/chunkeey.git] / target / linux / ipq806x / base-files / etc / hotplug.d / ieee80211 / 10_fix_wifi_mac
1 #!/bin/ash
2
3 [ "$ACTION" == "add" ] || exit 0
4
5 PHYNBR=${DEVPATH##*/phy}
6
7 [ -n $PHYNBR ] || exit 0
8
9 . /lib/functions.sh
10 . /lib/functions/system.sh
11
12 board=$(board_name)
13
14 case "$board" in
15 linksys,ea8500)
16 echo $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
17 ;;
18 netgear,d7800 |\
19 netgear,r7500v2 |\
20 netgear,r7800)
21 echo $(macaddr_add $(mtd_get_mac_binary art 6) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
22 ;;
23 tplink,c2600)
24 echo $(macaddr_add $(mtd_get_mac_binary default-mac 8) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
25 ;;
26 tplink,vr2600v)
27 echo $(macaddr_add $(mtd_get_mac_binary default-mac 0) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
28 ;;
29 zyxel,nbg6817)
30 echo $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) $((1 - $PHYNBR)) ) > /sys${DEVPATH}/macaddress
31 ;;
32 *)
33 ;;
34 esac