fix: some renewal files where missing (??)
This commit is contained in:
parent
67ca76f7f1
commit
919706b80e
1 changed files with 18 additions and 1 deletions
19
certbotd.sh
19
certbotd.sh
|
@ -89,10 +89,27 @@ case $1 in
|
|||
2>"${headers}" \
|
||||
| jq --raw-output .[] \
|
||||
| while read domain; do
|
||||
if test -z "${domain}"; then
|
||||
echo "not ok - domain is empty" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
# Skip already existing domains
|
||||
if test -f "/etc/letsencrypt/renewal/${domain}.conf"; then
|
||||
if test -s "/etc/letsencrypt/renewal/${domain}.conf"; then
|
||||
echo "ok - ${domain} already issued" >&2
|
||||
continue
|
||||
else
|
||||
echo "ok - ${domain} renewal conf was empty, fixing..." >&2
|
||||
|
||||
other_renewal="$(grep -l -m 1 "^authenticator = webroot$" /etc/letsencrypt/renewal/*.conf | head -1)"
|
||||
|
||||
if test -z "${other_renewal}"; then
|
||||
echo "not ok - ${domain} couldn't fix" >&2
|
||||
ensure 1
|
||||
fi
|
||||
|
||||
other_domain="$(basename "${other_renewal}" .conf)"
|
||||
sed -re "s/${other_domain}/${domain}/g" "${other_renewal}" > "/etc/letsencrypt/renewal/${domain}.conf"
|
||||
fi
|
||||
|
||||
# Ignore non local domains
|
||||
|
|
Loading…
Reference in a new issue