fixed renewal script #6
1 changed files with 6 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
||||||
function halt() {
|
function halt() {
|
||||||
#stop services if necessary
|
#stop services if necessary
|
||||||
if [ -d /var/lib/ipa/ ]
|
if [ -d /var/lib/ipa/ ]
|
||||||
|
then
|
||||||
#stop httpd
|
#stop httpd
|
||||||
systemctl stop httpd
|
systemctl stop httpd
|
||||||
fi
|
fi
|
||||||
|
@ -14,6 +15,7 @@ function reload() {
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
fi
|
fi
|
||||||
if [ -d /var/lib/ipa/ ]
|
if [ -d /var/lib/ipa/ ]
|
||||||
|
then
|
||||||
#restart httpd
|
#restart httpd
|
||||||
systemctl start httpd
|
systemctl start httpd
|
||||||
/scripts/setup-le.sh
|
/scripts/setup-le.sh
|
||||||
|
@ -37,9 +39,9 @@ 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
|
||||||
halt()
|
halt
|
||||||
certbot renew --cert-name $f >> /var/log/certbot-renewal.log
|
certbot renew --cert-name $f >> /var/log/certbot-renewal.log
|
||||||
reload()
|
reload
|
||||||
continue
|
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)
|
||||||
|
@ -51,9 +53,9 @@ 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
|
||||||
halt()
|
halt
|
||||||
certbot renew --cert-name $f >> $log
|
certbot renew --cert-name $f >> $log
|
||||||
reload()
|
reload
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue