d923cebdb34c373597d6f11a0e57e4b73f9f53f4

Author
Niccolò Maggioni <nicco.maggioni@gmail.com>
Committer
Niccolò Maggioni <nicco.maggioni@gmail.com>
Date

Message

Updated with @mcornella suggestions

Diff

 1diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh
 2index 5618ba8f1d02883b689640736e863470d5bd8c39..8c26333558987b8f9498e2de713bc7fefca8befc 100644
 3--- a/plugins/systemadmin/systemadmin.plugin.zsh
 4+++ b/plugins/systemadmin/systemadmin.plugin.zsh
 5@@ -140,12 +140,12 @@ d0() {
 6 
 7 # gather external ip address
 8 geteip() {
 9-    echo "$(curl -s -S http://ipecho.net/plain)"
10+    curl -s -S https://icanhazip.com
11 }
12 
13 # determine local IP address
14 getip() {
15-    if [ $(hash | grep '^ip=') ]; then
16+    if (( ${+commands[ip]} )); then
17         ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}'
18     else
19         ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'