check-certificates: use function for notification

This commit is contained in:
Christian Hesse 2018-10-09 15:52:08 +02:00
parent f262ff99a8
commit e89779ff9f

View file

@ -8,6 +8,8 @@
:global "email-general-to"; :global "email-general-to";
:global "email-general-cc"; :global "email-general-cc";
:global SendNotification;
:local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"); :local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
:local currentdate [ / system clock get date ]; :local currentdate [ / system clock get date ];
@ -36,9 +38,8 @@
:local fingerprint [ / certificate get $cert fingerprint ]; :local fingerprint [ / certificate get $cert fingerprint ];
:local invalidbefore [ / certificate get $cert invalid-before ]; :local invalidbefore [ / certificate get $cert invalid-before ];
:local invalidafter [ / certificate get $cert invalid-after ]; :local invalidafter [ / certificate get $cert invalid-after ];
/ tool e-mail send to=$"email-general-to" cc=$"email-general-cc" \ $SendNotification ("[" . $identity . "] Certificate warning!") \
subject=("[" . $identity . "] Certificate warning!") \ ("A certificate on " . $identity . " is about to expire.\n\n" . \
body=("A certificate on " . $identity . " is about to expire.\n\n" . \
"Certificate Name: " . $certname . "\n" . \ "Certificate Name: " . $certname . "\n" . \
"Common Name: " . $commonname . "\n" . \ "Common Name: " . $commonname . "\n" . \
"Fingerprint: " . $fingerprint . "\n" . \ "Fingerprint: " . $fingerprint . "\n" . \