diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2017-08-03 21:28:38 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2017-08-03 21:28:38 +0300 |
commit | 49c1bf8d55fef9e0c5057c9b134edbc39da13017 (patch) | |
tree | 75c6272c4ccd1a3a3cfbfcb79d8988c5e2a4652b | |
parent | 4781b1c1700f20053d4629372acdfcd153563ff3 (diff) |
[NETW-3006] Updated detection of MAC addresses on Linux
-rw-r--r-- | include/tests_networking | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/tests_networking b/include/tests_networking index ddb846d2..49b5b45d 100644 --- a/include/tests_networking +++ b/include/tests_networking @@ -266,6 +266,10 @@ Linux) if [ ! -z "${IFCONFIGBINARY}" ]; then FIND=$(${IFCONFIGBINARY} -a 2> /dev/null | ${GREPBINARY} "HWaddr" | ${AWKBINARY} '{ if ($4=="HWaddr") print $5 }' | ${SORTBINARY} -u) + # CentOS 7.x and others may return nothing. Let's retry with 'ether' field. + if [ -z "${FIND}" ]; then + FIND=$(${IFCONFIGBINARY} -a 2> /dev/null | ${AWKBINARY} '{ if ($1=="ether") print $2 }' | ${SORTBINARY} -u) + fi else if [ ! -z "${IPBINARY}" ]; then LogText "Test: Using ip binary to gather hardware addresses" |