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
9 IBwifis
="$(uci show meshwizard.netconfig | grep -v 'netconfig=netconfig' | sed 's/meshwizard.netconfig\.\(IB_wifi.*\)_.*/\1/' |uniq)"
10 [ -z "$(echo $IBwifis |grep IB_wifi)" ] && exit
13 posIB
=$
(( $posIB + 1 ))
14 export IB_wifi
$posIB="$w"
18 syswifis
="$(uci show wireless |grep wifi-device | sed 's/wireless\.\(.*\)=.*/\1/' |uniq)"
20 for s
in $syswifis; do
21 export syswifi
$pos="$s"
25 for i
in `seq 0 $posIB`; do
26 IBwifi
=$
(eval echo \
$IB_wifi$i)
27 syswifi
=$
(eval echo \
$syswifi$i)
29 if [ -n "$syswifi" ]; then
32 # replace IB_wifi_* with actual wifi interface names, delete old ones first
33 uci show meshwizard.netconfig |
grep $IBwifi |
while read line
; do
34 oldline
=$
(echo $line | cut
-d "=" -f 1)
36 newline
=$
(echo $line |
sed "s/$IBwifi/$syswifi/g")
46 uci_commitverbose
"Renaming wifi-devices in /etc/config/meshwizard" meshwizard