浏览代码

Updated with @mcornella suggestions

Niccolò Maggioni 8 年之前
父节点
当前提交
d923cebdb3
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/systemadmin/systemadmin.plugin.zsh

+ 2 - 2
plugins/systemadmin/systemadmin.plugin.zsh

@@ -140,12 +140,12 @@ d0() {
 
 # gather external ip address
 geteip() {
-    echo "$(curl -s -S http://ipecho.net/plain)"
+    curl -s -S https://icanhazip.com
 }
 
 # determine local IP address
 getip() {
-    if [ $(hash | grep '^ip=') ]; then
+    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}'