certbot: Add cron job to notify expiring certs

This commit is contained in:
Timo Makinen 2025-08-02 18:20:33 +00:00
parent 23dd98a34b
commit dac04ee011
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,16 @@
#!/bin/sh
set -eu
umask 077
certbot certificates 2> /dev/null | awk '
{
if (/^ Certificate Name: /) { cert = $3 }
if (/^ Expiry Date: /) {
days = $6
if (days < 30) {
print cert " " days " days"
}
}
}
'