minor, add more debug info

This commit is contained in:
neil 2016-07-15 16:40:03 +08:00
parent 1a6305c93f
commit dcf9cb581d

44
acme.sh
View File

@ -1,6 +1,6 @@
#!/usr/bin/env sh #!/usr/bin/env sh
VER=2.3.1 VER=2.3.2
PROJECT_NAME="acme.sh" PROJECT_NAME="acme.sh"
@ -902,9 +902,23 @@ _stopserver(){
return return
fi fi
_debug2 "Le_HTTPPort" "$Le_HTTPPort"
if [ "$Le_HTTPPort" ] ; then
if [ "$DEBUG" ] ; then
_get "http://localhost:$Le_HTTPPort"
else
_get "http://localhost:$Le_HTTPPort" >/dev/null 2>&1 _get "http://localhost:$Le_HTTPPort" >/dev/null 2>&1
_get "https://localhost:$Le_TLSPort" >/dev/null 2>&1 fi
fi
_debug2 "Le_TLSPort" "$Le_TLSPort"
if [ "$Le_TLSPort" ] ; then
if [ "$DEBUG" ] ; then
_get "https://localhost:$Le_TLSPort"
else
_get "https://localhost:$Le_TLSPort" >/dev/null 2>&1
fi
fi
} }
@ -1244,19 +1258,25 @@ _clearupwebbroot() {
return 0 return 0
fi fi
_rmpath=""
if [ "$2" = '1' ] ; then if [ "$2" = '1' ] ; then
_debug "remove $__webroot/.well-known" _rmpath="$__webroot/.well-known"
rm -rf "$__webroot/.well-known"
elif [ "$2" = '2' ] ; then elif [ "$2" = '2' ] ; then
_debug "remove $__webroot/.well-known/acme-challenge" _rmpath="$__webroot/.well-known/acme-challenge"
rm -rf "$__webroot/.well-known/acme-challenge"
elif [ "$2" = '3' ] ; then elif [ "$2" = '3' ] ; then
_debug "remove $__webroot/.well-known/acme-challenge/$3" _rmpath="$__webroot/.well-known/acme-challenge/$3"
rm -rf "$__webroot/.well-known/acme-challenge/$3"
else else
_debug "Skip for removelevel:$2" _debug "Skip for removelevel:$2"
fi fi
if [ "$_rmpath" ] ; then
if [ "$DEBUG" ] ; then
_debug "Debugging, skip removing: $_rmpath"
else
rm -rf "$_rmpath"
fi
fi
return 0 return 0
} }
@ -1735,6 +1755,11 @@ issue() {
else else
_err "$d:Verify error:$error" _err "$d:Verify error:$error"
fi fi
if [ "$DEBUG" ] ; then
if [ "$vtype" = "$VTYPE_HTTP" ] ; then
_get "http://$d/.well-known/acme-challenge/$token"
fi
fi
_clearupwebbroot "$_currentRoot" "$removelevel" "$token" _clearupwebbroot "$_currentRoot" "$removelevel" "$token"
_clearup _clearup
return 1; return 1;
@ -2806,6 +2831,9 @@ _process() {
shift 1 shift 1
done done
if [ "$DEBUG" ] ; then
version
fi
case "${_CMD}" in case "${_CMD}" in
install) install "$_nocron" ;; install) install "$_nocron" ;;