You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
640 B
Bash

#!/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