OpenWrt

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 1  →  ?path2? @ 2
/branches/18.06.1/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -0,0 +1,31 @@
#!/bin/ash
 
[ "$ACTION" == "add" ] || exit 0
 
PHYNBR=${DEVPATH##*/phy}
 
[ -n $PHYNBR ] || exit 0
 
. /lib/functions.sh
. /lib/functions/system.sh
 
OPATH=${DEVPATH##/devices/platform/}
OPATH=${OPATH%%/ieee*}
 
# 10 radios is enough for anyone!
for i in `seq 0 9`;
do
BUS=`uci get wireless.@wifi-device[$i].path`
if [ "$BUS " == "$OPATH " ]
then
PHYNAME=${DEVPATH##*ieee80211/}
NPHYNAME=`uci get wireless.@wifi-device[$i].phyname`
if [ "$NPHYNAME " != " " ]
then
if [ "$PHYNAME " != "$NPHYNAME " ]
then
iw $PHYNAME set name $NPHYNAME
fi
fi
fi
done