X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=net-functions;h=55458947cf554e7209a21b91464063dad48f9bad;hb=f5c2c78c1c02f6c9fc2a4c56c67a932ddea78e79;hp=a54676a28ffbfeb424005fddad05469c23dd5c34;hpb=a83e3825511532c96dd400447f2e0cc5e89600dd;p=grml-network.git diff --git a/net-functions b/net-functions index a54676a..5545894 100644 --- a/net-functions +++ b/net-functions @@ -3,11 +3,11 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Don Okt 12 09:41:32 CEST 2006 [mika] ################################################################################ defaultGWDev() { - ip r s | awk '/^default/ {print $5}' + # ip r s | awk '/^default/ {print $5}' + route -en | awk '/^0.0.0.0/ {print $8}' } getLanDevices() { @@ -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 #################################################################