浏览代码

General compatibility

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

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

@@ -145,7 +145,7 @@ geteip() {
 
 
 # determine local IP address
 # determine local IP address
 getip() {
 getip() {
-    if [ "$(which ip)" != "" ]; then
+    if [ $(hash | grep '^ip=') ]; then
         ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}'
         ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}'
     else
     else
         ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
         ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'