summaryrefslogtreecommitdiff
path: root/plugins/systemadmin/systemadmin.plugin.zsh
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-09-19 15:07:36 -0400
committerAndrew Janke <andrew@apjanke.net>2015-09-19 15:07:36 -0400
commit6cddf7202b8ef5c2eb2dfc081d870dc9e751d646 (patch)
treebe3fe162edbc04946eea014a3612280d4909dc1e /plugins/systemadmin/systemadmin.plugin.zsh
parent82c76f6b5c2718622a532fb759231e8d24171413 (diff)
parentcbc1a0806e910f7b4eed07b992d3d88ff7cb1162 (diff)
downloadzsh-6cddf7202b8ef5c2eb2dfc081d870dc9e751d646.tar.gz
zsh-6cddf7202b8ef5c2eb2dfc081d870dc9e751d646.tar.bz2
zsh-6cddf7202b8ef5c2eb2dfc081d870dc9e751d646.zip
Merge branch 'master' into installer-portable-colors
Diffstat (limited to 'plugins/systemadmin/systemadmin.plugin.zsh')
-rw-r--r--plugins/systemadmin/systemadmin.plugin.zsh8
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