I am looking for an automatic certificate renewal script for my Debian system.
So far I am using this one liner in crontab:
0 0 1 * * /opt/letsencrypt/letsencrypt-auto certonly --agree-tos --webroot --webroot-path /home/html/xy.eu/public_html/ -d xy.eu -d www.xy.eu --renew-by-default >> /var/log/letsencrypt/intechgrity-renew.log && service apache2 reload
I am looking for a smarter script which restarts apache2 only when the certificate was renewed. Optionally sends me an email about success/failed renewal.