aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sabatie <david.sabatie@notrenet.com>2017-06-03 21:11:24 +0300
committerDavid Sabatie <david.sabatie@notrenet.com>2017-06-03 21:11:24 +0300
commit9a3d2e4ca14897c98f5215c5961a1a3cfd214da2 (patch)
tree076d316692ffc8c9a6804f08e522446cb469b0ab
parent3c3a86a42f6299f8ccc9af27b4cb03467cb28927 (diff)
vpn prompt: change "ip" to "ifconfig" to be used on OSX
-rwxr-xr-xpowerlevel9k.zsh-theme5
1 files changed, 2 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index dc7f0388..5058e3b6 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -917,14 +917,13 @@ prompt_ip() {
set_default POWERLEVEL9K_VPN_IP_INTERFACE "tun"
# prompt if vpn active
prompt_vpn_ip() {
- for vpn_iface in $(ip tuntap | grep -e ^"$POWERLEVEL9K_VPN_IP_INTERFACE" | cut -d":" -f1)
+ for vpn_iface in $(/sbin/ifconfig | grep -e ^"$POWERLEVEL9K_VPN_IP_INTERFACE" | cut -d":" -f1)
do
- ip=$(ip -4 a show "$vpn_iface" | grep -o "inet\s*[0-9.]*" | grep -o "[0-9.]*")
+ ip=$(/sbin/ifconfig "$vpn_iface" | grep -o "inet\s.*" | cut -d' ' -f2)
"$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'VPN_ICON'
done
}
-
prompt_load() {
# The load segment can have three different states
local current_state="unknown"