_ip_addresses: Try with "ip addr" if ifconfig is not available.
This commit is contained in:
parent
b78ef321be
commit
aa516acdc5
@ -875,10 +875,11 @@ _configured_interfaces()
|
||||
#
|
||||
_ip_addresses()
|
||||
{
|
||||
local PATH=$PATH:/sbin
|
||||
COMPREPLY+=( $( compgen -W \
|
||||
"$( PATH="$PATH:/sbin" LC_ALL=C ifconfig -a |
|
||||
"$( { LC_ALL=C ifconfig -a || ip addr show; } 2>/dev/null |
|
||||
sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \
|
||||
-ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \
|
||||
-ne 's|.*inet[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p' )" \
|
||||
-- "$cur" ) )
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user