#!/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'` 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