aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-04-03 14:57:51 +0200
committerGravatar Christian Hesse <mail@eworm.de>2020-04-03 15:03:27 +0200
commit324f5b0ba428abf477f128577f2f6c3604a15ab5 (patch)
tree07b21fb8f1b94efce6342b30162824978bb92499
parente963e091148dd095cd9d1510eae0249849309e4e (diff)
global-functions: $SendTelegram: check status of certificate download
-rw-r--r--global-functions7
1 files changed, 5 insertions, 2 deletions
diff --git a/global-functions b/global-functions
index 05d98ed..29ce59d 100644
--- a/global-functions
+++ b/global-functions
@@ -596,8 +596,9 @@
:global TelegramChatId;
:global TelegramChatIdOverride;
- :global UrlEncode;
:global CertificateAvailable;
+ :global LogPrintExit;
+ :global UrlEncode;
:local ChatId $TelegramChatId;
:if ([ :len $TelegramChatIdOverride ] > 0) do={
@@ -608,8 +609,10 @@
:return false;
}
- $CertificateAvailable "Go Daddy Secure Certificate Authority - G2";
:do {
+ :if ([ $CertificateAvailable "Go Daddy Secure Certificate Authority - G2" ] = false) do={
+ $LogPrintExit warning ("Downloading required certificate failed.") true;
+ }
/ tool fetch check-certificate=yes-without-crl output=none http-method=post \
("https://api.telegram.org/bot" . $TelegramTokenId . "/sendMessage") \
http-data=("chat_id=" . $ChatId . "&disable_notification=" . $Silent . \