aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-04-27 20:58:19 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-04-28 13:58:37 +0200
commit71976f2eb92c68d8754385b318162d55b9171817 (patch)
treefa3b9bbe343d3ec4ccf0151f2fa31203dc3588e2
parent76f32e3927d2e40f2b6cc28f93186bf84d222799 (diff)
check-certificates: use $SendNotification2
-rw-r--r--check-certificates14
1 files changed, 7 insertions, 7 deletions
diff --git a/check-certificates b/check-certificates
index f99b20a..ff93046 100644
--- a/check-certificates
+++ b/check-certificates
@@ -20,7 +20,7 @@
:global IfThenElse;
:global LogPrintExit2;
:global ParseKeyValueStore;
-:global SendNotification;
+:global SendNotification2;
:global SymbolForNotification;
:global UrlEncode;
:global WaitForFile;
@@ -95,15 +95,15 @@ $WaitFullyConnected;
/ certificate set $CertNew name=($CertVal->"name");
}
- $SendNotification ([ $SymbolForNotification "lock-with-ink-pen" ] . "Certificate renewed") \
- ("A certificate on " . $Identity . " has been renewed.\n\n" . \
+ $SendNotification2 ({ subject=([ $SymbolForNotification "lock-with-ink-pen" ] . "Certificate renewed"); \
+ message=("A certificate on " . $Identity . " has been renewed.\n\n" . \
"Name: " . ($CertVal->"name") . "\n" . \
"CommonName: " . ($CertNewVal->"common-name") . "\n" . \
"Private key: " . [ $IfThenElse (($CertNewVal->"private-key") = true) "available" "missing" ] . "\n" . \
"Fingerprint: " . ($CertNewVal->"fingerprint") . "\n" . \
"Issuer: " . ([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN") . "\n" . \
"Validity: " . ($CertNewVal->"invalid-before") . " to " . ($CertNewVal->"invalid-after") . "\n" . \
- "Expires in: " . [ $FormatExpire ($CertNewVal->"expires-after") ]) "" "true";
+ "Expires in: " . [ $FormatExpire ($CertNewVal->"expires-after") ]); silent=true });
$LogPrintExit2 info $0 ("The certificate " . ($CertVal->"name") . " has been renewed.") false;
} on-error={
$LogPrintExit2 debug $0 ("Could not renew certificate " . ($CertVal->"name") . ".") false;
@@ -118,15 +118,15 @@ $WaitFullyConnected;
} else={
:local State [ $IfThenElse (($CertVal->"expired") = true) "expired" "is about to expire" ];
- $SendNotification ([ $SymbolForNotification "warning-sign" ] . "Certificate warning!") \
- ("A certificate on " . $Identity . " " . $State . ".\n\n" . \
+ $SendNotification2 ({ subject=([ $SymbolForNotification "warning-sign" ] . "Certificate warning!"); \
+ message=("A certificate on " . $Identity . " " . $State . ".\n\n" . \
"Name: " . ($CertVal->"name") . "\n" . \
"CommonName: " . ($CertVal->"common-name") . "\n" . \
"Private key: " . [ $IfThenElse (($CertNewVal->"private-key") = true) "available" "missing" ] . "\n" . \
"Fingerprint: " . ($CertVal->"fingerprint") . "\n" . \
"Issuer: " . ($CertVal->"ca") . ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN") . "\n" . \
"Validity: " . ($CertVal->"invalid-before") . " to " . ($CertVal->"invalid-after") . "\n" . \
- "Expires in: " . [ $IfThenElse (($CertVal->"expired") = true) "expired" [ $FormatExpire ($CertVal->"expires-after") ] ]);
+ "Expires in: " . [ $IfThenElse (($CertVal->"expired") = true) "expired" [ $FormatExpire ($CertVal->"expires-after") ] ]) });
$LogPrintExit2 info $0 ("The certificate " . ($CertVal->"name") . " " . $State . \
", it is invalid after " . ($CertVal->"invalid-after") . ".") false;
}