X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=contrib%2Fpackage%2Fmeshwizard%2Ffiles%2Fusr%2Fbin%2Fmeshwizard%2Fhelpers%2Frename-wifi.sh;h=f2d10cc9e20b92a9dd7bcbd297a61f8942fb4416;hb=refs%2Fpull%2F997%2Fhead;hp=aee15f5b74f6abf14a677828cd880f49e74cb244;hpb=ab87896104be09072ccccad305588d46370ab5ad;p=project%2Fluci.git diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh index aee15f5b7..f2d10cc9e 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh @@ -1,10 +1,13 @@ #!/bin/sh # This script renames IB_wifi_ interface names into real interface names used on this system. -# E.g. wireless.IB_wifi0 would become wireless.wifi0 on madwifi and wireless.radio0 on mac80211 +# E.g. wireless.IB_wifi0 would become wireless.radio0 on mac80211 + +. $dir/functions.sh posIB=-1 -IBwifis="$(uci show meshwizard.netconfig | grep -v 'netconfig=netconfig' | sed 's/meshwizard.netconfig\.\(IB_wifi.*\)_.*/\1/' |uniq)" +IBwifis="$(uci show meshwizard.netconfig | grep 'IB_' | sed 's/meshwizard.netconfig\.\(IB_wifi.*\)_.*/\1/' |uniq)" +[ -z "$(echo $IBwifis |grep IB_wifi)" ] && exit for w in $IBwifis; do posIB=$(( $posIB + 1 )) @@ -30,7 +33,7 @@ for i in `seq 0 $posIB`; do uci show meshwizard.netconfig | grep $IBwifi | while read line; do oldline=$(echo $line | cut -d "=" -f 1) uci set $oldline="" - newline=$(echo $line |sed "s/$IBwifi/$syswifi/g") + newline=$(echo $line |sed -e "s/$IBwifi/$syswifi/g" -e "s/'//g") uci set $newline done ;; @@ -40,4 +43,4 @@ for i in `seq 0 $posIB`; do fi done -uci commit +uci_commitverbose "Renaming wifi-devices in /etc/config/meshwizard" meshwizard