mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: $SendTelegram: invert condition
This commit is contained in:
@ -438,16 +438,18 @@
|
||||
:set ChatId $TelegramChatIdOverride;
|
||||
}
|
||||
|
||||
:if ([ :len $TelegramTokenId ] > 0 && [ :len $ChatId ] > 0) do={
|
||||
$CertificateAvailable "Go Daddy Secure Certificate Authority - G2";
|
||||
:do {
|
||||
/ 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 . \
|
||||
"&text=" . [ $UrlEncode ("[" . $Identity . "] " . $Subject . "\n\n" . $Message) ]);
|
||||
} on-error={
|
||||
:log warning "Failed sending telegram notification!";
|
||||
}
|
||||
:if ([ :len $TelegramTokenId ] = 0 || [ :len $ChatId ] = 0) do={
|
||||
:return;
|
||||
}
|
||||
|
||||
$CertificateAvailable "Go Daddy Secure Certificate Authority - G2";
|
||||
:do {
|
||||
/ 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 . \
|
||||
"&text=" . [ $UrlEncode ("[" . $Identity . "] " . $Subject . "\n\n" . $Message) ]);
|
||||
} on-error={
|
||||
:log warning "Failed sending telegram notification!";
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user