projects
/
grml-hwinfo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7397995
)
Collect information about network devices via ethtool
author
Michael Prokop
<mika@grml.org>
Fri, 8 Sep 2023 09:59:13 +0000
(11:59 +0200)
committer
Michael Prokop
<mika@grml.org>
Fri, 8 Sep 2023 09:59:13 +0000
(11:59 +0200)
grml-hwinfo
patch
|
blob
|
history
diff --git
a/grml-hwinfo
b/grml-hwinfo
index
0281e39
..
6583080
100755
(executable)
--- a/
grml-hwinfo
+++ b/
grml-hwinfo
@@
-160,6
+160,17
@@
disk_info() {
disklist=$(lsblk -nd -o NAME -e 7,11)
}
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
(
cd "${OUTDIR}" || exit 1
(
@@
-236,6
+247,23
@@
cd "${OUTDIR}" || exit 1
exectest ifconfig && ifconfig -v -a > ./ifconfig
exectest route && route -n > ./route
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
# net stuff, iproute:
exectest ip && ip addrlabel list > ip_addrlabel
exectest ip && ip addr show > ip_addr