mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-15 09:32:45 +02:00
trying to fix #320 again
This commit is contained in:
+8
-5
@@ -472,7 +472,7 @@ sign_csr() {
|
|||||||
|
|
||||||
challenge_status="$(printf '%s' "${response}" | rm_json_arrays | get_json_string_value status)"
|
challenge_status="$(printf '%s' "${response}" | rm_json_arrays | get_json_string_value status)"
|
||||||
if [ "${challenge_status}" = "valid" ]; then
|
if [ "${challenge_status}" = "valid" ]; then
|
||||||
echo " + Already validated"
|
echo " + Already validated!"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -510,9 +510,10 @@ sign_csr() {
|
|||||||
deploy_args[${idx}]="${altname} ${challenge_token} ${keyauth_hook}"
|
deploy_args[${idx}]="${altname} ${challenge_token} ${keyauth_hook}"
|
||||||
idx=$((idx+1))
|
idx=$((idx+1))
|
||||||
done
|
done
|
||||||
|
challenge_count="${idx}"
|
||||||
|
|
||||||
# Wait for hook script to deploy the challenges if used
|
# Wait for hook script to deploy the challenges if used
|
||||||
if [ ${#deploy_args[@]} -ne 0 ]; then
|
if [[ ${challenge_count} -ne 0 ]]; then
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
[[ -n "${HOOK}" ]] && [[ "${HOOK_CHAIN}" = "yes" ]] && "${HOOK}" "deploy_challenge" ${deploy_args[@]}
|
[[ -n "${HOOK}" ]] && [[ "${HOOK_CHAIN}" = "yes" ]] && "${HOOK}" "deploy_challenge" ${deploy_args[@]}
|
||||||
fi
|
fi
|
||||||
@@ -520,7 +521,7 @@ sign_csr() {
|
|||||||
# Respond to challenges
|
# Respond to challenges
|
||||||
reqstatus="valid"
|
reqstatus="valid"
|
||||||
idx=0
|
idx=0
|
||||||
if [ ${#challenge_altnames[@]} -ne 0 ]; then
|
if [ ${challenge_count} -ne 0 ]; then
|
||||||
for altname in "${challenge_altnames[@]:0}"; do
|
for altname in "${challenge_altnames[@]:0}"; do
|
||||||
challenge_token="${challenge_tokens[${idx}]}"
|
challenge_token="${challenge_tokens[${idx}]}"
|
||||||
keyauth="${keyauths[${idx}]}"
|
keyauth="${keyauths[${idx}]}"
|
||||||
@@ -560,11 +561,13 @@ sign_csr() {
|
|||||||
|
|
||||||
# Wait for hook script to clean the challenges if used
|
# Wait for hook script to clean the challenges if used
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
[[ -n "${HOOK}" ]] && [[ "${HOOK_CHAIN}" = "yes" ]] && "${HOOK}" "clean_challenge" ${deploy_args[@]}
|
if [[ ${challenge_count} -ne 0 ]]; then
|
||||||
|
[[ -n "${HOOK}" ]] && [[ "${HOOK_CHAIN}" = "yes" ]] && "${HOOK}" "clean_challenge" ${deploy_args[@]}
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${reqstatus}" != "valid" ]]; then
|
if [[ "${reqstatus}" != "valid" ]]; then
|
||||||
# Clean up any remaining challenge_tokens if we stopped early
|
# Clean up any remaining challenge_tokens if we stopped early
|
||||||
if [[ "${CHALLENGETYPE}" = "http-01" ]]; then
|
if [[ "${CHALLENGETYPE}" = "http-01" ]] && [[ ${challenge_count} -ne 0 ]]; then
|
||||||
while [ ${idx} -lt ${#challenge_tokens[@]} ]; do
|
while [ ${idx} -lt ${#challenge_tokens[@]} ]; do
|
||||||
rm -f "${WELLKNOWN}/${challenge_tokens[${idx}]}"
|
rm -f "${WELLKNOWN}/${challenge_tokens[${idx}]}"
|
||||||
idx=$((idx+1))
|
idx=$((idx+1))
|
||||||
|
|||||||
Reference in New Issue
Block a user