[ACME] Force renewal with force_renew file, docs will follow

This commit is contained in:
andryyy
2020-03-03 14:59:24 +01:00
parent a6f59edcab
commit e19e6b9e92
3 changed files with 4 additions and 3 deletions

View File

@@ -345,6 +345,7 @@ while true; do
# reload on new or changed certificates
if [[ "${CERT_CHANGED}" == "1" ]]; then
rm -f "${ACME_BASE}/force_renew" 2> /dev/null
CERT_AMOUNT_CHANGED=${CERT_AMOUNT_CHANGED} /srv/reload-configurations.sh
fi

View File

@@ -39,8 +39,8 @@ else
fi
if [[ -f ${DOMAINS_FILE} && "$(cat ${DOMAINS_FILE})" == "${CERT_DOMAINS[*]}" ]]; then
if [[ ! -f ${CERT} || ! -f "${KEY}" ]]; then
log_f "Certificate ${CERT} doesn't exist yet - start obtaining"
if [[ ! -f ${CERT} || ! -f "${KEY}" || -f "${ACME_BASE}/force_renew" ]]; then
log_f "Certificate ${CERT} doesn't exist yet or forced renewal - start obtaining"
# Certificate exists and did not change but could be due for renewal (30 days)
elif ! openssl x509 -checkend 2592000 -noout -in ${CERT} > /dev/null; then
log_f "Certificate ${CERT} is due for renewal (< 30 days) - start renewing"