Skip to content

Instantly share code, notes, and snippets.

@radiofrequency
Created October 12, 2020 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radiofrequency/21593036ddca1138235a7184902262f7 to your computer and use it in GitHub Desktop.
Save radiofrequency/21593036ddca1138235a7184902262f7 to your computer and use it in GitHub Desktop.
show lets encrypt certificates that are expired
unix_todate=$(date -d "${todate}" "+%s")
for pem in /etc/letsencrypt/live/*/cert.pem; do
if [ $(date --date="$(openssl x509 -enddate -noout -in "$pem"|cut -d= -f 2)" "+%s") -le $unix_todate ];
then
printf '%s: %s\n' \
"$(date --date="$(openssl x509 -enddate -noout -in "$pem"|cut -d= -f 2)" --iso-8601)" \
"$pem"
fi
done | sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment