From 18b41087551da7346cb419ed2135674277c2507a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 19 Apr 2008 07:22:30 +0000 Subject: add support for parsing newer ifconfig output Signed-off-by: Mike Frysinger --- net/ifconfig.sh.Linux.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in index f82f25c3..6b613640 100644 --- a/net/ifconfig.sh.Linux.in +++ b/net/ifconfig.sh.Linux.in @@ -56,7 +56,7 @@ _set_flag() _get_mac_address() { local mac=$(LC_ALL=C ifconfig "${IFACE}" | \ - sed -n -e 's/.* HWaddr \(..:..:..:..:..:..\).*/\1/p') + sed -n -e 's/.* \(HWaddr\|ether\) \(..:..:..:..:..:..\).*/\2/p') case "${mac}" in 00:00:00:00:00:00);; @@ -77,7 +77,7 @@ _set_mac_address() _get_inet_address() { set -- $(LC_ALL=C ifconfig "${IFACE}" | - sed -n -e 's/.*inet addr:\([^ ]*\).*Mask:\([^ ]*\).*/\1 \2/p') + sed -n -e 's/.*\(inet addr:\|inet \)\([^ ]*\).*\(Mask:\|netmask \)\([^ ]*\).*/\2 \4/p') [ -z "$1" ] && return 1 echo -n "$1" @@ -145,7 +145,7 @@ _add_address() # IPv4 is tricky - ifconfig requires an aliased device # for multiple addresses local iface="${IFACE}" - if LC_ALL=C ifconfig "${iface}" | grep -Eq "\