diff options
author | Chris McCuller <cmcculler@salesforce.com> | 2015-09-21 22:19:15 -0400 |
---|---|---|
committer | Chris McCuller <cmcculler@salesforce.com> | 2015-09-21 22:19:15 -0400 |
commit | e6ccd37b0563b4e7b34c41034766b9789e43ee5c (patch) | |
tree | c12c8c2c6437fd7d5d3ec5bff27634a80759b808 /plugins/systemadmin | |
parent | 30ef85664822595e29acdbc840c45d5772d84b5d (diff) | |
parent | 76a26a2a59d8c6d0f65a4426cdb93920e255aea7 (diff) | |
download | zsh-e6ccd37b0563b4e7b34c41034766b9789e43ee5c.tar.gz zsh-e6ccd37b0563b4e7b34c41034766b9789e43ee5c.tar.bz2 zsh-e6ccd37b0563b4e7b34c41034766b9789e43ee5c.zip |
Merge master (rebase being super annoying). Fix conflicts
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 |