hw-test/scripts/scan-netdev

20 lines
448 B
Text
Raw Normal View History

2016-12-12 13:31:47 -06:00
#!/bin/bash
if [ -z $OUTPUT_DIR ] ; then
source scan-dmidecode
fi
echo "#DEV MA:CA:DD:RE:SS" > $OUTPUT_DIR/netdev.lst
2016-12-12 13:31:47 -06:00
for DEV in \
`cat /proc/net/dev | grep ':' | cut -d ':' -f 1`
do
MAC=`ethtool -P $DEV | cut -d ':' -f 2-9 | sed 's/\s\+//g'`
if [ "$MAC" != "00:00:00:00:00:00" ] ; then
2016-12-21 23:24:52 -06:00
#echo "$DEV $MAC"
echo "$DEV $MAC" >> $OUTPUT_DIR/netdev.lst
mkdir -p $OUTPUT_DIR/netdev
ethtool $DEV > $OUTPUT_DIR/netdev/$DEV.ethtool
fi
2016-12-12 13:31:47 -06:00
done