Add automatic certiicate renewal, fixes #1 #3

Merged
ejparker merged 6 commits from renewal into prod 2025-03-22 20:18:18 -05:00
Showing only changes of commit 4a4275cb0c - Show all commits

View file

@ -11,7 +11,8 @@ do
if [[ $today > $expires ]] if [[ $today > $expires ]]
then then
echo Certificate for $f is expired, renewing >> $log echo Certificate for $f is expired, renewing >> $log
certbot renew --cert-name $f --dry-run >> /var/log/certbot-renewal.log certbot renew --cert-name $f >> /var/log/certbot-renewal.log
continue
fi 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) #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)
hash=$(echo $f| md5sum) hash=$(echo $f| md5sum)
@ -22,7 +23,7 @@ do
if [[ $dom -eq $rdate ]] if [[ $dom -eq $rdate ]]
then then
echo Date falls within renewal window for $f, attempting renewal >> $log echo Date falls within renewal window for $f, attempting renewal >> $log
certbot renew --cert-name $f --dry-run >> $log certbot renew --cert-name $f >> $log
break break
fi fi
done done