X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=grml-hwinfo;fp=grml-hwinfo;h=65830801608f55e9c1c705e29f253474decac3f8;hb=79336ef9b3f81d2e96006ef776c28fdbd3a3cd37;hp=0281e395eddf2f74122b315e50874232cf68cff5;hpb=7397995c4ec9cbb7a5d348f91e4792c30025f558;p=grml-hwinfo.git diff --git a/grml-hwinfo b/grml-hwinfo index 0281e39..6583080 100755 --- a/grml-hwinfo +++ b/grml-hwinfo @@ -160,6 +160,17 @@ disk_info() { disklist=$(lsblk -nd -o NAME -e 7,11) } +# return list of all network devices in array "${niclist[@]}" +get_network_devices() { + local interface + niclist=() + for interface in /sys/class/net/* ; do + [ -e "${interface}" ] || continue + interface=$(basename "${interface}") + # [ "${interface}" = "lo" ] && continue + niclist+=("${interface}") + done +} cd "${OUTDIR}" || exit 1 ( @@ -236,6 +247,23 @@ cd "${OUTDIR}" || exit 1 exectest ifconfig && ifconfig -v -a > ./ifconfig exectest route && route -n > ./route + # net stuff, ethtool + if exectest ethtool ; then + get_network_devices + for dev in "${niclist[@]}" ; do + ethtool "${dev}" > ethtool_"${dev}" + case "${dev}" in + "lo") + # skip the loopback device, `ethtool --driver lo` fails with: + # "Cannot get driver information: Operation not supported" + ;; + *) + ethtool --driver "${dev}" > ethtool_"${dev}_driver" + ;; + esac + done + fi + # net stuff, iproute: exectest ip && ip addrlabel list > ip_addrlabel exectest ip && ip addr show > ip_addr