#!/bin/bash
if type /sbin/ethtool > /dev/null 2>/dev/null ; then
ethtool=/sbin/ethtool
else type ethtool >/dev/null 2>/dev/null
ethtool=ethtool
fi
if [ -z != $ethtool ] ; then
for eth in $(cat /proc/net/dev | egrep -v 'vif|xapi|vnet|tap|veth' | sed -rn -e 's/[[:space:]]*//g' -e '/ *([^:]):.*/s//\1/p' | egrep -vx '(lo|sit.*)')
do
echo $eth $($ethtool $eth | egrep '(Speed|Duplex|Link detected|Auto-negotiation):' | cut -d: -f2 | sed 's/ *//g')
done
fi