2 # This script renames IB_wifi_ interface names into real interface names used on this system.
3 # E.g. wireless.IB_wifi0 would become wireless.wifi0 on madwifi and wireless.radio0 on mac80211
7 IBwifis="$(uci show meshwizard.netconfig | grep -v 'netconfig=netconfig' | sed 's/meshwizard.netconfig\.\(IB_wifi.*\)_.*/\1/' |uniq)"
10 posIB=$(( $posIB + 1 ))
11 export IB_wifi$posIB="$w"
15 syswifis="$(uci show wireless |grep wifi-device | sed 's/wireless\.\(.*\)=.*/\1/' |uniq)"
17 for s in $syswifis; do
18 export syswifi$pos="$s"
22 for i in `seq 0 $posIB`; do
23 IBwifi=$(eval echo \$IB_wifi$i)
24 syswifi=$(eval echo \$syswifi$i)
26 if [ -n "$syswifi" ]; then
29 # replace IB_wifi_* with actual wifi interface names, delete old ones first
30 uci show meshwizard.netconfig | grep $IBwifi | while read line; do
31 oldline=$(echo $line | cut -d "=" -f 1)
33 newline=$(echo $line |sed "s/$IBwifi/$syswifi/g")