diff options
Diffstat (limited to 'rc.wireless')
-rw-r--r-- | rc.wireless | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rc.wireless b/rc.wireless index e7a35b8..d742ae1 100644 --- a/rc.wireless +++ b/rc.wireless @@ -89,11 +89,11 @@ IFCOMMAND="/sbin/ip link set dev ${INTERFACE}" is_wireless_device () { # Return 0 for a wireless interface, or 1 for a non-wireless interface. - if LC_ALL=C $IWPATH/iwconfig $1 2>&1 | grep -q "IEEE 802.11" ; then + if [ -d /sys/class/net/${1}/wireless ]; then return 0 - elif [ -d /sys/class/net/${1}/wireless ]; then + elif grep -Fxq 'DEVTYPE=wlan' /sys/class/net/${1}/uevent 2>/dev/null; then return 0 - elif [ "$(cat /sys/class/net/${1}/uevent | grep DEVTYPE)" = "DEVTYPE=wlan" ]; then + elif LC_ALL=C $IWPATH/iwconfig $1 2>&1 | grep -q "IEEE 802.11" ; then return 0 else # all tests failed, assume the device is not wireless (or add a better test :) return 1 |