From: Lukas Schauer Date: Tue, 18 Jul 2017 01:29:32 +0000 (+0200) Subject: fixed error handling on non-2xx http status codes (#413) X-Git-Tag: v0.5.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c57ad87e7cba55da19842f2a5bb331d927b4bbf5;p=thirdparty%2Fdehydrated.git fixed error handling on non-2xx http status codes (#413) --- diff --git a/dehydrated b/dehydrated index 13220c7..be57fa0 100755 --- a/dehydrated +++ b/dehydrated @@ -412,10 +412,12 @@ http_request() { fi if [[ ! "${statuscode:0:1}" = "2" ]]; then - if [[ "${2}" = "${CA_REVOKE_CERT}" ]] && [[ "${statuscode}" = "409" ]]; then + if [[ -n "${CA_REVOKE_CERT:-}" ]] && [[ "${2}" = "${CA_REVOKE_CERT:-}" ]] && [[ "${statuscode}" = "409" ]]; then grep -q "Certificate already revoked" "${tempcont}" && return - fi - if [[ ! "${2}" = "${CA_TERMS}" ]] || [[ ! "${statuscode:0:1}" = "3" ]]; then + elif [[ -n "${CA_TERMS:-}" ]] && [[ "${2}" = "${CA_TERMS:-}" ]] && [[ "${statuscode:0:1}" = "3" ]]; then + # do nothing + : + else echo " + ERROR: An error occurred while sending ${1}-request to ${2} (Status ${statuscode})" >&2 echo >&2 echo "Details:" >&2