Commit abb95693 authored by Lukas Schauer's avatar Lukas Schauer

check for errors on token retrieval

parent 537f6fb7
......@@ -51,6 +51,11 @@ sign_domain() {
challenge_token="$(echo $response | grep -Eo '"challenges":[^\[]*\[[^]]*]' | sed 's/{/\n{/g' | grep 'http-01' | grep -Eo '"token":\s*"[^"]*"' | cut -d'"' -f4 | sed 's/[^A-Za-z0-9_\-]/_/g')"
challenge_uri="$(echo $response | grep -Eo '"challenges":[^\[]*\[[^]]*]' | sed 's/{/\n{/g' | grep 'http-01' | grep -Eo '"uri":\s*"[^"]*"' | cut -d'"' -f4)"
if [ "${challenge_token}" = "" ] || [ "${challenge_uri}" = "" ]; then
echo " + Error: Can't retrieve challenges (${reqsponse})"
exit 1
fi
keyauth="${challenge_token}.${thumbprint}"
echo -n "${keyauth}" > "${WELLKNOWN}/${challenge_token}"
......
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