Private
Public Access
1
0

Clean stale certbot data before SSL acquisition attempt

If a previous certbot run created live/archive/renewal dirs but
failed to complete, the next attempt would choke on the existing
'live directory'. Now cleans these before each attempt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
constantprojects
2026-02-24 09:11:08 -07:00
parent 3a6cf54d92
commit 6a164ab40d

View File

@@ -47,6 +47,11 @@ else
echo "Requesting Let's Encrypt certificate for ${DOMAIN}..."
# Clean stale certbot data from any previous failed attempt
rm -rf "/etc/letsencrypt/live/${DOMAIN}" \
"/etc/letsencrypt/archive/${DOMAIN}" \
"/etc/letsencrypt/renewal/${DOMAIN}.conf" 2>/dev/null || true
# Attempt certificate acquisition
if certbot certonly --webroot \
-w /var/www/certbot \