wol: Try "ip addr" before ifconfig for finding out broadcast addresses.
This commit is contained in:
parent
87dede96c0
commit
19ce23282c
@ -11,9 +11,11 @@ _wol()
|
|||||||
;;
|
;;
|
||||||
-h|--host|-i|--ipaddr)
|
-h|--host|-i|--ipaddr)
|
||||||
# Broadcast addresses
|
# Broadcast addresses
|
||||||
COMPREPLY=( $( PATH=$PATH:/sbin ifconfig -a 2>/dev/null | \
|
local PATH=$PATH:/sbin
|
||||||
sed -ne 's/.*[[:space:]]\{1,\}Bcast:\([^[:space:]]*\).*/\1/p' \
|
COMPREPLY=( $( { ip addr show || ifconfig -a; } 2>/dev/null | \
|
||||||
-e 's/.*[[:space:]]\{1,\}broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' ) )
|
sed -ne 's/.*[[:space:]]Bcast:\([^[:space:]]*\).*/\1/p' -ne \
|
||||||
|
's/.*inet.*[[:space:]]brd[[:space:]]\([^[:space:]]*\).*/\1/p' -ne \
|
||||||
|
's/.*[[:space:]]broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' ) )
|
||||||
_known_hosts_real "$cur"
|
_known_hosts_real "$cur"
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user