Skip to content

Instantly share code, notes, and snippets.

@epixoip
Created May 20, 2020 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epixoip/d9587235ad7951f7691485864f540efa to your computer and use it in GitHub Desktop.
Save epixoip/d9587235ad7951f7691485864f540efa to your computer and use it in GitHub Desktop.
#!/bin/sh
for i in /sys/class/net/*; do
printf "%-10s Driver: %-10s State: %s\n" \
"$(basename $i)" \
"$(sed -rn 's/DRIVER=(.*)/\1/p' $i/device/uevent 2>/dev/null || echo unknown)" \
"$(cat $i/operstate)"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment