diff options
author | Tim O'Brien <timo@t413.com> | 2015-09-14 15:39:18 -0700 |
---|---|---|
committer | Tim O'Brien <timo@t413.com> | 2015-09-14 15:39:18 -0700 |
commit | e8639c700ebbf8aa416c0d14c8e3a292f1062dd7 (patch) | |
tree | 7705714541cc8781a1be7e1d2343d34e5e8aa9b1 /plugins/systemadmin | |
parent | 797e1f9a64c0d2775723bb28c76745b327f86d56 (diff) | |
parent | 9c08641d7c2aae0c82fa5ad91f94c67b70115ba5 (diff) | |
download | zsh-e8639c700ebbf8aa416c0d14c8e3a292f1062dd7.tar.gz zsh-e8639c700ebbf8aa416c0d14c8e3a292f1062dd7.tar.bz2 zsh-e8639c700ebbf8aa416c0d14c8e3a292f1062dd7.zip |
Update to current robbyrussell/oh-my-zsh master
Diffstat (limited to 'plugins/systemadmin')
-rw-r--r-- | plugins/systemadmin/systemadmin.plugin.zsh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh index 4ae70dfa7..8c2633355 100644 --- a/plugins/systemadmin/systemadmin.plugin.zsh +++ b/plugins/systemadmin/systemadmin.plugin.zsh @@ -140,12 +140,16 @@ d0() { # gather external ip address geteip() { - curl http://ifconfig.me + curl -s -S https://icanhazip.com } # determine local IP address getip() { - ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' + if (( ${+commands[ip]} )); then + ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}' + else + ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' + fi } # Clear zombie processes |