use iproute2's ip, if available

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-05-31 19:30:51 +02:00
parent 5ad0805fa9
commit f087057c98

View file

@ -23,8 +23,13 @@
# If your OS is not supported please provide a ifconfig output
#
uname_s="$(uname -s)"
# Use ip, if available
if which ip >/dev/null 2>&1; then
ip -o link show | sed -n 's/^[0-9]\+: \(.\+\): <.*/\1/p'
exit 0
fi
uname_s="$(uname -s)"
REGEXP='s/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p'
case "$uname_s" in