net-functions: getLanDriver() does not return driver for madwifi
authorMichael Prokop <mika@grml.org>
Mon, 3 Nov 2008 17:22:53 +0000 (18:22 +0100)
committerMichael Prokop <mika@grml.org>
Mon, 3 Nov 2008 17:22:53 +0000 (18:22 +0100)
debian/changelog
net-functions

index adc7d57..fdf33ff 100644 (file)
@@ -1,3 +1,10 @@
+grml-network (0.2.5) unstable; urgency=low
+
+  * net-functions: getLanDriver() does not return driver for madwifi.
+    Thanks for the fix to Ulrich Dangel. [Closes: issue551]
+
+ -- Michael Prokop <mika@grml.org>  Mon, 03 Nov 2008 18:22:01 +0100
+
 grml-network (0.2.4) unstable; urgency=low
 
   * net-functions: if there is a default route not via an ip
index 07c333f..5545894 100644 (file)
@@ -22,9 +22,9 @@ getWlanDevices() {
 
 # getLanDriver deviceName
 getLanDriver() {
-  DEVICE="$1"
-  echo $DEVICE | grep -q ath && DEVICE=$(echo $DEVICE | sed 's/ath/wifi/')
-  ethtool -i $DEVICE 2>/dev/null | awk '/^driver:/{print $2}'
+    if [ -e /sys/class/net/$1/device/driver ] ; then
+        basename $(readlink /sys/class/net/$1/device/driver)
+    fi
 }
 
 ## END OF FILE #################################################################