mac80211: remove error from detect script
authorFelix Fietkau <nbd@openwrt.org>
Thu, 9 Oct 2014 09:04:24 +0000 (09:04 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 9 Oct 2014 09:04:24 +0000 (09:04 +0000)
Signed-off-by: Michel Stam <m.stam@fugro.nl>
SVN-Revision: 42861

package/kernel/mac80211/files/lib/wifi/mac80211.sh

index a3b2199507f91fb44f5edb37d4445f0a420ea3ce..0b662eb4b113b08d7f8555cac5bf065b6b05af77 100644 (file)
@@ -19,9 +19,11 @@ lookup_phy() {
 
        local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
        [ -n "$macaddr" ] && {
-               for _phy in $(ls /sys/class/ieee80211 2>/dev/null); do
-                       [ "$macaddr" = "$(cat /sys/class/ieee80211/${_phy}/macaddress)" ] || continue
-                       phy="$_phy"
+               for _phy in /sys/class/ieee80211/*; do
+                       [ -e "$_phy" ] || continue
+
+                       [ "$macaddr" = "$(cat ${_phy}/macaddress)" ] || continue
+                       phy="${_phy##*/}"
                        return
                done
        }
@@ -65,7 +67,12 @@ detect_mac80211() {
                [ -n "$type" ] || break
                devidx=$(($devidx + 1))
        done
-       for dev in $(ls /sys/class/ieee80211); do
+
+       for _dev in /sys/class/ieee80211/*; do
+               [ -e "$_dev" ] || continue
+
+               dev="${_dev##*/}"
+
                found=0
                config_foreach check_mac80211_device wifi-device
                [ "$found" -gt 0 ] && continue