20 lines
493 B
Bash
Executable file
20 lines
493 B
Bash
Executable file
#!/bin/bash
|
|
|
|
if [[ -z $OUTPUT_DIR ]] ; then
|
|
source scan-dmidecode
|
|
fi
|
|
|
|
echo "#DEV MA:CA:DD:RE:SS" > $OUTPUT_DIR/netdev.lst
|
|
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'`
|
|
#MAC=`cat /sys/class/net/$DEV/address`
|
|
if [[ "$MAC" != "00:00:00:00:00:00" ]] ; then
|
|
#echo "$DEV $MAC"
|
|
echo "$DEV $MAC" >> $OUTPUT_DIR/netdev.lst
|
|
mkdir -p $OUTPUT_DIR/netdev
|
|
ethtool $DEV > $OUTPUT_DIR/netdev/$DEV.ethtool
|
|
fi
|
|
done
|
|
|