mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-24 17:28:29 +02:00
only write csr file if renewal will be requested
This commit is contained in:
@@ -1170,14 +1170,16 @@ command_sign_domains() {
|
|||||||
skip="no"
|
skip="no"
|
||||||
|
|
||||||
# Allow for external CSR generation
|
# Allow for external CSR generation
|
||||||
|
local csr=""
|
||||||
if [[ -n "${HOOK}" ]]; then
|
if [[ -n "${HOOK}" ]]; then
|
||||||
local csr="$("${HOOK}" "generate_csr" "${domain}" "${certdir}" "${domain} ${morenames}")"
|
csr="$("${HOOK}" "generate_csr" "${domain}" "${certdir}" "${domain} ${morenames}")"
|
||||||
if grep -q "\-----BEGIN CERTIFICATE REQUEST-----" <<< "${csr}"; then
|
if grep -q "\-----BEGIN CERTIFICATE REQUEST-----" <<< "${csr}"; then
|
||||||
altnames="$(extract_altnames "${csr}")"
|
altnames="$(extract_altnames "${csr}")"
|
||||||
domain="$(cut -d' ' -f1 <<< "${altnames}")"
|
domain="$(cut -d' ' -f1 <<< "${altnames}")"
|
||||||
morenames="$(cut -s -d' ' -f2- <<< "${altnames}")"
|
morenames="$(cut -s -d' ' -f2- <<< "${altnames}")"
|
||||||
echo " + Using CSR from hook script (real names: ${altnames})"
|
echo " + Using CSR from hook script (real names: ${altnames})"
|
||||||
printf "%s" "${csr}" > "${certdir}/cert-${timestamp}.csr"
|
else
|
||||||
|
csr=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1227,6 +1229,7 @@ command_sign_domains() {
|
|||||||
# Sign certificate for this domain
|
# Sign certificate for this domain
|
||||||
if [[ ! "${skip}" = "yes" ]]; then
|
if [[ ! "${skip}" = "yes" ]]; then
|
||||||
update_ocsp="yes"
|
update_ocsp="yes"
|
||||||
|
[[ -z "${csr}" ]] || printf "%s" "${csr}" > "${certdir}/cert-${timestamp}.csr"
|
||||||
if [[ "${PARAM_KEEP_GOING:-}" = "yes" ]]; then
|
if [[ "${PARAM_KEEP_GOING:-}" = "yes" ]]; then
|
||||||
sign_domain "${certdir}" ${timestamp} ${domain} ${morenames} &
|
sign_domain "${certdir}" ${timestamp} ${domain} ${morenames} &
|
||||||
wait $! || true
|
wait $! || true
|
||||||
|
|||||||
Reference in New Issue
Block a user