hw-test/scripts/scan-netdev

24 lines
520 B
Text
Raw Normal View History

2016-12-12 13:31:47 -06:00
#!/bin/bash
2016-12-22 23:27:05 -06:00
if [[ -z $OUTPUT_DIR ]] ; then
2016-12-12 13:31:47 -06:00
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 \
2017-01-25 22:30:16 -06:00
`cat /proc/net/dev \
| grep -v bond \
| grep ':' \
| cut -d ':' -f 1`
2016-12-12 13:31:47 -06:00
do
MAC=`ethtool -P $DEV | cut -d ':' -f 2-9 | sed 's/\s\+//g'`
2016-12-23 01:00:24 -06:00
#MAC=`cat /sys/class/net/$DEV/address`
2016-12-22 23:27:05 -06:00
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