59c58f9c6747bbc9acbf2c9c1a491b2c6e840b28
[openwrt/openwrt.git] / target / linux / ath79 / 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 . /lib/functions/k2t.sh
12
13 board=$(board_name)
14
15 case "$board" in
16 phicomm,k2t)
17 # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
18 [ "$PHYNBR" -eq 1 ] && \
19 echo $(k2t_get_mac "lan_mac") > /sys${DEVPATH}/macaddress
20 ;;
21 *)
22 ;;
23 esac
24