minor, add more debug info

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

48
acme.sh
View File

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