forked from ungleich-public/cdist
use iproute2's ip, if available
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
5ad0805fa9
commit
f087057c98
1 changed files with 6 additions and 1 deletions
|
@ -23,8 +23,13 @@
|
||||||
# If your OS is not supported please provide a ifconfig output
|
# 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'
|
REGEXP='s/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p'
|
||||||
|
|
||||||
case "$uname_s" in
|
case "$uname_s" in
|
||||||
|
|
Loading…
Reference in a new issue