diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-02-06 18:52:56 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-02-06 18:52:56 +0300 |
commit | 730ef08dfbbdd0ffc3cf762c5e00fe8f617ed48e (patch) | |
tree | 9c62b6e3ecc97c50903f5e636f424e140ee73523 /internal | |
parent | 80139d8949a055af937d07a459a4e755d787cdbc (diff) | |
parent | d17c7278a5ac8f0273ff8ae6ee9d997bff959891 (diff) |
Merge branch 'master' into asdf
Diffstat (limited to 'internal')
-rw-r--r-- | internal/p10k.zsh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f53b0ad3..273096b4 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4750,8 +4750,8 @@ function _p9k_prompt_net_iface_async() { # netstat -inbI en0 local iface ip line var typeset -a iface2ip - if [[ -x /sbin/ifconfig ]]; then - for line in ${(f)"$(/sbin/ifconfig 2>/dev/null)"}; do + if (( $+commands[ifconfig] )); then + for line in ${(f)"$(command ifconfig 2>/dev/null)"}; do if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=(<->)'<'* ]]; then [[ $match[2] == *[13579] ]] && iface=$match[1] || iface= elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then @@ -4759,8 +4759,8 @@ function _p9k_prompt_net_iface_async() { iface= fi done - elif [[ -x /sbin/ip ]]; then - for line in ${(f)"$(/sbin/ip -4 a show 2>/dev/null)"}; do + elif (( $+commands[ip] )); then + for line in ${(f)"$(command ip -4 a show 2>/dev/null)"}; do if [[ $line == (#b)<->:[[:space:]]##([^:]##):[[:space:]]##\<([^\>]#)\>* ]]; then [[ ,$match[2], == *,UP,* ]] && iface=$match[1] || iface= elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then |