tn3399_openwrt/target/linux/ramips/mt76x8/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

24 lines
517 B
Plaintext

[ "$ACTION" == "add" ] || exit 0
PHYNBR=${DEVPATH##*/phy}
[ -n $PHYNBR ] || exit 0
. /lib/functions.sh
. /lib/functions/system.sh
board=$(board_name)
case "$board" in
hiwifi,hc5611|\
hiwifi,hc5661a|\
hiwifi,hc5761a|\
hiwifi,hc5861b)
label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
echo -n "$label_mac" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
;;
esac