From b7e210969a9f0aedda2a7c1a29ec92618887d116 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 20 Jan 2006 21:48:20 +0000 Subject: get hwaddrs from sysfs as opposed to ip | sed, etc. --- sysconfig/network-scripts/network-functions | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sysconfig') diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index d72283ad..b813f891 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -9,8 +9,14 @@ export PATH get_hwaddr () { - LC_ALL= LANG= ip -o link show ${1} 2>/dev/null | \ - sed 's/.*link\/[^ ]* \([[:alnum:]:]*\).*/\1/' | \ + { + if [ -f /sys/class/net/${1}/address ]; then + cat /sys/class/net/${1}/address + else + LC_ALL= LANG= ip -o link show ${1} 2>/dev/null | \ + sed 's/.*link\/[^ ]* \([[:alnum:]:]*\).*/\1/' + fi + } | \ awk '{ print toupper($0) }' } -- cgit v1.2.1