mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-16 13:04:30 +02:00
global-functions: $SendTelegram: invert condition
This commit is contained in:
parent
34db2e34db
commit
227151e189
1 changed files with 12 additions and 10 deletions
|
@ -438,16 +438,18 @@
|
||||||
:set ChatId $TelegramChatIdOverride;
|
:set ChatId $TelegramChatIdOverride;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len $TelegramTokenId ] > 0 && [ :len $ChatId ] > 0) do={
|
:if ([ :len $TelegramTokenId ] = 0 || [ :len $ChatId ] = 0) do={
|
||||||
$CertificateAvailable "Go Daddy Secure Certificate Authority - G2";
|
:return;
|
||||||
:do {
|
}
|
||||||
/ tool fetch check-certificate=yes-without-crl output=none http-method=post \
|
|
||||||
("https://api.telegram.org/bot" . $TelegramTokenId . "/sendMessage") \
|
$CertificateAvailable "Go Daddy Secure Certificate Authority - G2";
|
||||||
http-data=("chat_id=" . $ChatId . "&disable_notification=" . $Silent . \
|
:do {
|
||||||
"&text=" . [ $UrlEncode ("[" . $Identity . "] " . $Subject . "\n\n" . $Message) ]);
|
/ tool fetch check-certificate=yes-without-crl output=none http-method=post \
|
||||||
} on-error={
|
("https://api.telegram.org/bot" . $TelegramTokenId . "/sendMessage") \
|
||||||
:log warning "Failed sending telegram notification!";
|
http-data=("chat_id=" . $ChatId . "&disable_notification=" . $Silent . \
|
||||||
}
|
"&text=" . [ $UrlEncode ("[" . $Identity . "] " . $Subject . "\n\n" . $Message) ]);
|
||||||
|
} on-error={
|
||||||
|
:log warning "Failed sending telegram notification!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue