openwrt/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac

22 lines
423 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
zyxel,emg2926-q10a|\
zyxel,nbg6716)
ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr)
[ "$PHYNBR" -eq 0 ] && \
macaddr_add $ethaddr 1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" -eq 1 ] && \
echo -n $ethaddr > /sys${DEVPATH}/macaddress
;;
esac