mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-23 16:58:28 +02:00
check for errors on token retrieval
This commit is contained in:
@@ -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_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)"
|
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}"
|
keyauth="${challenge_token}.${thumbprint}"
|
||||||
|
|
||||||
echo -n "${keyauth}" > "${WELLKNOWN}/${challenge_token}"
|
echo -n "${keyauth}" > "${WELLKNOWN}/${challenge_token}"
|
||||||
|
|||||||
Reference in New Issue
Block a user