From: Michael Prokop Date: Thu, 22 Dec 2011 01:21:29 +0000 (+0100) Subject: netcardconfig: fix WLAN card detection X-Git-Tag: v0.5.2~1 X-Git-Url: http://git.grml.org/?p=grml-network.git;a=commitdiff_plain;h=a3e63c3034ad832cd2ee4358de36ffe4252f653a netcardconfig: fix WLAN card detection Thanks: Ulrich Dangel for the patch. --- diff --git a/sbin/netcardconfig b/sbin/netcardconfig index ba8d7bf..8561dae 100755 --- a/sbin/netcardconfig +++ b/sbin/netcardconfig @@ -498,11 +498,15 @@ fi if [ -z "$WLAN" ] ; then WLAN_OLD=$(tail -n +3 /proc/net/wireless 2>/dev/null|awk -F: '{print $1}') # /proc/net/wireless does not work e.g. with iwl3945 on kernel 2.6.33 anymore - WLAN_NEW=$(for i in /sys/class/net/* ; do [ -d $i/wireless ] && basename $i ; done) - WLAN=$(echo $WLAN_OLD $WLAN_NEW | sort -u) + WLAN_NEW=$(for i in /sys/class/net/* ; do ( [ -d $i/wireless ] || [ -d $i/phy80211 ] ) && basename $i ; done) + set -a WLAN_IWCONFIG="" + for DEV in $LAN ; do + iwconfig $DEV 2>/dev/null 1>&2 && WLAN_IWCONFIG+="$DEV" + done + WLAN=$(echo $WLAN_OLD $WLAN_NEW ${WLAN_IWCONFIG[*]} | sort -u) fi -unset LAN_DEVICES WLAN_DEVICES FIREWIRE_DEVICES NETDEVICES +unset LAN_DEVICES WLAN_DEVICES FIREWIRE_DEVICES NETDEVICES WLAN_IWCONFIG while read dev mac; do #echo "Making NETDEVICES $NETDEVICESCOUNT $dev"