From e80682c6f74b5e9acb832566add601b61ef2aa0e Mon Sep 17 00:00:00 2001 From: rongdede Date: Thu, 24 Mar 2016 22:23:42 +0800 Subject: [PATCH] bug --- serverspeeder-all.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/serverspeeder-all.sh b/serverspeeder-all.sh index 75f96cd..dd44483 100644 --- a/serverspeeder-all.sh +++ b/serverspeeder-all.sh @@ -196,8 +196,12 @@ rm -rf serverspeederbin.txt # echo NETCARD=$NETCARD if [ "$1" == "" ]; then - MACSTR="LANG=C ifconfig eth0 | awk '/ether/{ print \$2 }' " + MACSTR="LANG=C ifconfig eth0 | awk '/HWaddr/{ print \$5 }' " MAC=$(eval $MACSTR) + if [ "$MAC" == "" ]; then + MACSTR="LANG=C ifconfig eth0 | awk '/ether/{ print \$2 }' " + MAC=$(eval $MACSTR) + fi if [ "$MAC" == "" ]; then MAC=$(ip link | awk -F ether '{print $2}' | awk NF | awk 'NR==1{print $1}') fi