aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sysconfig/network-scripts/network-functions10
1 files changed, 8 insertions, 2 deletions
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) }'
}