From 324f5b0ba428abf477f128577f2f6c3604a15ab5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 3 Apr 2020 14:57:51 +0200 Subject: global-functions: $SendTelegram: check status of certificate download --- global-functions | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'global-functions') 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 . \ -- cgit v1.2.3-54-g00ecf