Skip to content

Instantly share code, notes, and snippets.

@cseelye
Created August 2, 2017 23:34
Show Gist options
  • Save cseelye/e0d7da9eb1ee5a57ba11352551d94d8f to your computer and use it in GitHub Desktop.
Save cseelye/e0d7da9eb1ee5a57ba11352551d94d8f to your computer and use it in GitHub Desktop.
#!/bin/bash
for nic in $(find /sys/class/net/ -type l); do
# Only look at physical NICs
[[ $(readlink -f ${nic}) =~ "virtual" ]] && continue
echo "========================================================="
ifname=$(basename ${nic})
ifconfig ${ifname}
ethtool ${ifname} | grep --color=none "Supported ports:" | sed -re 's/^\s+//g'
ethtool -i ${ifname} | grep --color=none bus-info | sed -re 's/^\s+//g'
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment