2016-12-12 13:31:47 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -z $OUTPUT_DIR ] ; then
|
|
|
|
source scan-dmidecode
|
|
|
|
fi
|
|
|
|
|
2016-12-13 18:31:14 -06:00
|
|
|
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
|
2016-12-13 18:31:14 -06:00
|
|
|
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"
|
2016-12-13 18:31:14 -06:00
|
|
|
echo "$DEV $MAC" >> $OUTPUT_DIR/netdev.lst
|
2016-12-13 19:31:58 -06:00
|
|
|
mkdir -p $OUTPUT_DIR/netdev
|
|
|
|
ethtool $DEV > $OUTPUT_DIR/netdev/$DEV.ethtool
|
2016-12-13 18:31:14 -06:00
|
|
|
fi
|
2016-12-12 13:31:47 -06:00
|
|
|
done
|
|
|
|
|