Browse Source

fix compatible for sh

neil 9 years ago
parent
commit
eac18b1c99
1 changed files with 5 additions and 1 deletions
  1. 5 1
      acme.sh

+ 5 - 1
acme.sh

@@ -62,7 +62,11 @@ _exists() {
     _err "Usage: _exists cmd"
     _err "Usage: _exists cmd"
     return 1
     return 1
   fi
   fi
-  command -v $cmd >/dev/null 2>&1
+  if type command >/dev/null 2>&1 ; then
+    command -v $cmd >/dev/null 2>&1
+  else
+    type $cmd >/dev/null 2>&1
+  fi
   ret="$?"
   ret="$?"
   _debug2 "$cmd exists=$ret"
   _debug2 "$cmd exists=$ret"
   return $ret
   return $ret