global-functions: $SendTelegram: check status of certificate download

This commit is contained in:
Christian Hesse 2020-04-03 14:57:51 +02:00
parent e963e09114
commit 324f5b0ba4

View file

@ -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 . \