Join us on Discord! We now have an official Discord server for OpenFLIXR: https://discord.gg/PcCErTQ , these forums will continue to operate as normal.

Script for alerting to expiring LetsEncrypt certs

If you're like me and need to manually intervene in some way to renew your Let's Encrypt SSL certs, then the below can send you email alerts as a reminder that the cert are expiring soon.

First, install `ssh-cert-check` from https://github.com/Matty9191/ssl-cert-check
As root:
cd /opt
git clone https://github.com/Matty9191/ssl-cert-check.git
cd ssl-cert-check
git pull https://github.com/Matty9191/ssl-cert-check.git master

Then grab my script from `https://gist.github.com/jeremysherriff/474e5f1e2d690cdbad5f0afa1df437aa`
Edit it and check install path, cert path(s), expiry days, email sender & receiver & mail server.
Then schedule it daily or weekly with cron.

For bonus points, add the new git repo to the OpenFLIXR "user" weekly update script so that it stays up to date of there are bugfixes (the user weekly update script is at /opt/openflixr/userscript.sh):
cd /opt/ssl-cert-check
git reset --hard
git pull


Comments

  • I’ll have a look. There’s a lot of let’s Encrypt stuff on my list to be fixed. 
  • Updated for some error handling and stuff that wasn't going the way I thought it would.
    And better linked into a daily cron job than in the weekly update user script if days is <21.
Sign In or Register to comment.