sh/dash compatible if and changed debug message

This commit is contained in:
David Mcanulty 2016-04-21 10:16:37 -07:00
parent acc7c235ca
commit 83c8248a07

16
acme.sh
View File

@ -491,13 +491,13 @@ _post() {
CURL="$CURL --dump-header $HTTP_HEADER " CURL="$CURL --dump-header $HTTP_HEADER "
if [ "$needbase64" ] ; then if [ "$needbase64" ] ; then
response="$($CURL -A "User-Agent: $USER_AGENT" -X POST --data "$body" $url | _base64)" response="$($CURL -A "User-Agent: $USER_AGENT" -X POST --data "$body" $url | _base64)"
if [[ $? -gt 0 ]] ;then if [ $? -gt 0 ] ;then
_err "Curl failed with exit code $?, trying running script in DEBUG=2 mode" _err "Curl failed with exit code $?, trying running script with --debug 2"
fi fi
else else
response="$($CURL -A "User-Agent: $USER_AGENT" -X POST --data "$body" $url)" response="$($CURL -A "User-Agent: $USER_AGENT" -X POST --data "$body" $url)"
if [[ $? -gt 0 ]] ;then if [ $? -gt 0 ] ;then
_err "Curl failed with exit code $?, trying running script in DEBUG=2 mode" _err "Curl failed with exit code $?, trying running script with --debug 2"
fi fi
fi fi
else else
@ -520,13 +520,13 @@ _get() {
if _exists "curl" ; then if _exists "curl" ; then
if [ "$onlyheader" ] ; then if [ "$onlyheader" ] ; then
$CURL -I -A "User-Agent: $USER_AGENT" $url $CURL -I -A "User-Agent: $USER_AGENT" $url
if [[ $? -gt 0 ]] ;then if [ $? -gt 0 ] ;then
_err "Curl failed with exit code $?, trying running script in DEBUG=2 mode" _err "Curl failed with exit code $?, trying running script with --debug 2"
fi fi
else else
$CURL -A "User-Agent: $USER_AGENT" $url $CURL -A "User-Agent: $USER_AGENT" $url
if [[ $? -gt 0 ]] ;then if [ $? -gt 0 ] ;then
_err "Curl failed with exit code $?, trying running script in DEBUG=2 mode" _err "Curl failed with exit code $?, trying running script with --debug 2"
fi fi
fi fi
else else