#!/bin/bash
sed 1,2d /proc/net/dev | egrep -v 'vif|xapi|vnet|tap|veth'
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 $(sed -e 1,2d < /proc/net/dev | egrep -v 'vif|xapi|vnet|tap|veth' | cut -d':' -f1)
do
echo "[$eth]"
$ethtool $eth | egrep '(Speed|Duplex|Link detected|Auto-negotiation):'
done
fi