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
|
|
|
|
|
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 \
|
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
|
2016-12-13 18:31:14 -06:00
|
|
|
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"
|
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
|
|
|
|
|