From 82dc2244c00b9de6636eebff2a0ec3dce3bcb174 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 17 Nov 2016 13:17:29 +0800 Subject: [PATCH] fix _exists for busybox --- acme.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/acme.sh b/acme.sh index 280cb415..a4a08392 100755 --- a/acme.sh +++ b/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="$?"