From 6a27a94e8101474f0d558b16c8a44cfffb8d52cb Mon Sep 17 00:00:00 2001 From: Jayne Passmore Date: Thu, 24 Jul 2025 15:32:12 -0500 Subject: [PATCH] fixed renewal script --- files/certbot-renewal.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/files/certbot-renewal.sh b/files/certbot-renewal.sh index 01f3b23..121256e 100644 --- a/files/certbot-renewal.sh +++ b/files/certbot-renewal.sh @@ -3,6 +3,7 @@ function halt() { #stop services if necessary if [ -d /var/lib/ipa/ ] + then #stop httpd systemctl stop httpd fi @@ -14,6 +15,7 @@ function reload() { systemctl reload nginx fi if [ -d /var/lib/ipa/ ] + then #restart httpd systemctl start httpd /scripts/setup-le.sh @@ -37,9 +39,9 @@ do if [[ $today > $expires ]] then echo Certificate for $f is expired, renewing >> $log - halt() + halt certbot renew --cert-name $f >> /var/log/certbot-renewal.log - reload() + reload continue fi #convert hostname into day of month between 0 and 28 to renew on specific day of month (reduce chance of running out of cert renewals) @@ -51,9 +53,9 @@ do if [[ $dom -eq $rdate ]] then echo Date falls within renewal window for $f, attempting renewal >> $log - halt() + halt certbot renew --cert-name $f >> $log - reload() + reload break fi done