Commit 831b973a authored by Lukas Schauer's avatar Lukas Schauer

Merge pull request #11 from germeier/fixpending

fixed logic to check status from our challenge
parents 3390080c 76a37834
...@@ -144,17 +144,20 @@ sign_domain() { ...@@ -144,17 +144,20 @@ sign_domain() {
result="$(signed_request "${challenge_uri}" '{"resource": "challenge", "keyAuthorization": "'"${keyauth}"'"}')" result="$(signed_request "${challenge_uri}" '{"resource": "challenge", "keyAuthorization": "'"${keyauth}"'"}')"
status="$(printf '%s\n' "${result}" | grep -Eo '"status":\s*"[^"]*"' | cut -d'"' -f4)" status="$(printf '%s\n' "${result}" | grep -Eo '"status":\s*"[^"]*"' | cut -d'"' -f4)"
if [[ ! "${status}" = "pending" ]] && [[ ! "${status}" = "valid" ]]; then
echo " + Challenge is invalid! (${result})"
exit 1
fi
# get status until it a result is reached => not pending anymore
while [[ "${status}" = "pending" ]]; do while [[ "${status}" = "pending" ]]; do
status="$(_request get "${challenge_uri}" | grep -Eo '"status":\s*"[^"]*"' | cut -d'"' -f4)"
sleep 1 sleep 1
status="$(_request get "${challenge_uri}" | grep -Eo '"status":\s*"[^"]*"' | cut -d'"' -f4)"
done done
echo " + Challenge is valid!" if [[ "${status}" = "valid" ]]; then
echo " + Challenge is valid!"
else
echo " + Challenge is invalid! (returned: ${status})"
exit 1
fi
done done
# Finally request certificate from the acme-server and store it in cert-${timestamp}.pem and link from cert.pem # Finally request certificate from the acme-server and store it in cert-${timestamp}.pem and link from cert.pem
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment