Browse Source

fix _exists for busybox

neil 8 years ago
parent
commit
82dc2244c0
1 changed files with 5 additions and 2 deletions
  1. 5 2
      acme.sh

+ 5 - 2
acme.sh

@@ -247,9 +247,12 @@ _exists() {
     _usage "Usage: _exists cmd"
     return 1
   fi
-  if command >/dev/null 2>&1; then
+
+  if eval type type >/dev/null 2>&1; then
+    eval type "$cmd" >/dev/null 2>&1
+  elif command >/dev/null 2>&1; then
     command -v "$cmd" >/dev/null 2>&1
-  elif which ls >/dev/null 2>&1; then
+  elif which which >/dev/null 2>&1; then
     which "$cmd" >/dev/null 2>&1
   fi
   ret="$?"