Last active
April 14, 2016 17:25
-
-
Save ianling/df4eb614ce02c34c58f901c9b1b07568 to your computer and use it in GitHub Desktop.
Bash script that checks each Let's Encrypt cert to make sure it won't expire soon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for cert in `find /etc/letsencrypt/live -name 'cert.pem'` ; do | |
certpath=`/usr/bin/dirname $cert` | |
website=`basename $certpath` | |
if /usr/bin/openssl x509 -checkend 2592000 -noout -in $cert ; then | |
echo "Cert for $website is good" | |
else | |
echo "**Cert for $website is bad**" | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment