aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-01-20 21:48:20 +0000
committerBill Nottingham <notting@redhat.com>2006-01-20 21:48:20 +0000
commitb7e210969a9f0aedda2a7c1a29ec92618887d116 (patch)
treea3529eb82166f2422532f44966a784eff55cce04
parente663d820642852369388229d4fdd297009e2408b (diff)
downloadinitscripts-b7e210969a9f0aedda2a7c1a29ec92618887d116.tar
initscripts-b7e210969a9f0aedda2a7c1a29ec92618887d116.tar.gz
initscripts-b7e210969a9f0aedda2a7c1a29ec92618887d116.tar.bz2
initscripts-b7e210969a9f0aedda2a7c1a29ec92618887d116.tar.xz
initscripts-b7e210969a9f0aedda2a7c1a29ec92618887d116.zip
get hwaddrs from sysfs as opposed to ip | sed, etc.
-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) }'
}