certbot: Add cron job to notify expiring certs
This commit is contained in:
parent
23dd98a34b
commit
dac04ee011
2 changed files with 33 additions and 0 deletions
16
roles/certbot/files/check-certs.sh
Executable file
16
roles/certbot/files/check-certs.sh
Executable 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
'
|
Loading…
Add table
Add a link
Reference in a new issue