mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-07-07 09:51:33 +00:00
Compare commits
97 commits
9d7b4157d6
...
75b7252c11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75b7252c11 | ||
|
|
c2538fb7a6 | ||
|
|
63f394c3e8 | ||
|
|
fd96f8bbc3 | ||
|
|
094683e104 | ||
|
|
49dd935e03 | ||
|
|
62b48e3002 | ||
|
|
e6ac506129 | ||
|
|
b2086fe336 | ||
|
|
315826db13 | ||
|
|
9f041b09ff | ||
|
|
4c4db2f234 | ||
|
|
fb4bb23204 | ||
|
|
43ab7e5f5f | ||
|
|
368449178a | ||
|
|
ff7cc16dca | ||
|
|
645a343970 | ||
|
|
cb3ebc122f | ||
|
|
2357768a31 | ||
|
|
64488eb014 | ||
|
|
b71c87a1f9 | ||
|
|
957a5121e4 | ||
|
|
4ec8a097b3 | ||
|
|
0fe17de762 | ||
|
|
624c2bc9b3 | ||
|
|
2c626d8ab6 | ||
|
|
ac5db7dc71 | ||
|
|
b6f28bb5ec | ||
|
|
c43a5df335 | ||
|
|
2e2e4f4130 | ||
|
|
970b6d9648 | ||
|
|
6910388bd0 | ||
|
|
586e10c407 | ||
|
|
8a16568f58 | ||
|
|
d7e9e84811 | ||
|
|
0e5cae02ff | ||
|
|
6d1d82bc14 | ||
|
|
ecefdc94b4 | ||
|
|
4ef067fd19 | ||
|
|
260199aada | ||
|
|
2fc74b8ad7 | ||
|
|
e0cb1622ca | ||
|
|
94ae6b5cfe | ||
|
|
bbe42fbd8f | ||
|
|
2af110300a | ||
|
|
6c12552276 | ||
|
|
d407c17a47 | ||
|
|
7b18953cf8 | ||
|
|
434c523f85 | ||
|
|
759ac0f725 | ||
|
|
c0a952c2b0 | ||
|
|
ec2c2e20bf | ||
|
|
04e0a73f6a | ||
|
|
93055d40eb | ||
|
|
8d150e3864 | ||
|
|
6fe9f90575 | ||
|
|
1dbdca15ca | ||
|
|
4527681fa8 | ||
|
|
7b610bd48d | ||
|
|
0d35c825a0 | ||
|
|
89eaaf3fea | ||
|
|
488cb3cf90 | ||
|
|
f58d503a40 | ||
|
|
a792ed0c52 | ||
|
|
e08b6d80a3 | ||
|
|
c4de33e064 | ||
|
|
8a1dc2205e | ||
|
|
84832aed73 | ||
|
|
c9dead9e0f | ||
|
|
6d5ee0c792 | ||
|
|
ba06ed446c | ||
|
|
4c5be0c7be | ||
|
|
072afadb80 | ||
|
|
edcafc8fc0 | ||
|
|
38a8d5caef | ||
|
|
b79d559ca8 | ||
|
|
d44f649a1b | ||
|
|
442b9f1171 | ||
|
|
95e2fc05b8 | ||
|
|
7f5b053b4d | ||
|
|
5e5f5a38bf | ||
|
|
da8f3abfc8 | ||
|
|
cb76d16317 | ||
|
|
813db8aad1 | ||
|
|
e210b1e215 | ||
|
|
7149d79980 | ||
|
|
665ae36b23 | ||
|
|
500cfdba3e | ||
|
|
08a6725fcb | ||
|
|
00d262b630 | ||
|
|
19f8e7e400 | ||
|
|
9c95587e55 | ||
|
|
ceb06fd9ea | ||
|
|
2b947691bd | ||
|
|
cb58973796 | ||
|
|
0eca62bab8 | ||
|
|
861c6db278 |
11 changed files with 51 additions and 42 deletions
|
|
@ -29,6 +29,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification2;
|
:global SendNotification2;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
:global UrlEncode;
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
:local CheckCertificatesDownloadImport do={
|
:local CheckCertificatesDownloadImport do={
|
||||||
|
|
@ -44,10 +45,11 @@
|
||||||
:global FetchUserAgentStr;
|
:global FetchUserAgentStr;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global RmFile;
|
:global RmFile;
|
||||||
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
|
|
||||||
:foreach Type in={ "p12"; "pem" } do={
|
:foreach Type in={ "p12"; "pem" } do={
|
||||||
:local CertFileName ([ :convert to=url $FetchName ] . "." . $Type);
|
:local CertFileName ([ $UrlEncode $FetchName ] . "." . $Type);
|
||||||
$LogPrint debug $ScriptName ("Trying type '" . $Type . "' for '" . $CertName . \
|
$LogPrint debug $ScriptName ("Trying type '" . $Type . "' for '" . $CertName . \
|
||||||
"' (file '" . $CertFileName . "')...");
|
"' (file '" . $CertFileName . "')...");
|
||||||
|
|
||||||
|
|
@ -198,7 +200,7 @@
|
||||||
} else={
|
} else={
|
||||||
$LogPrint debug $ScriptName ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced.");
|
$LogPrint debug $ScriptName ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced.");
|
||||||
|
|
||||||
:local CertNew [ /certificate/find where name~("^" . [ $EscapeForRegEx [ :convert to=url $FetchName ] ] . "\\.(p12|pem)_[0-9]+\$") \
|
:local CertNew [ /certificate/find where name~("^" . [ $EscapeForRegEx [ $UrlEncode $FetchName ] ] . "\\.(p12|pem)_[0-9]+\$") \
|
||||||
(common-name=($CertVal->"common-name") or subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $LastName ] . "(\\W|\$)")) \
|
(common-name=($CertVal->"common-name") or subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $LastName ] . "(\\W|\$)")) \
|
||||||
fingerprint!=[ :tostr ($CertVal->"fingerprint") ] ];
|
fingerprint!=[ :tostr ($CertVal->"fingerprint") ] ];
|
||||||
:local CertNewVal [ /certificate/get $CertNew ];
|
:local CertNewVal [ /certificate/get $CertNew ];
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification2;
|
:global SendNotification2;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
|
|
@ -75,7 +76,7 @@
|
||||||
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||||
} else={
|
} else={
|
||||||
:local Link ($DailyPskQrCodeUrl . \
|
:local Link ($DailyPskQrCodeUrl . \
|
||||||
"?scale=8&level=1&ssid=" . [ :convert to=url $Ssid ] . "&pass=" . [ :convert to=url $NewPsk ]);
|
"?scale=8&level=1&ssid=" . [ $UrlEncode $Ssid ] . "&pass=" . [ $UrlEncode $NewPsk ]);
|
||||||
$SendNotification2 ({ origin=$ScriptName; \
|
$SendNotification2 ({ origin=$ScriptName; \
|
||||||
subject=([ $SymbolForNotification "calendar" ] . "daily PSK " . $Ssid); \
|
subject=([ $SymbolForNotification "calendar" ] . "daily PSK " . $Ssid); \
|
||||||
message=("This is the daily PSK on " . $Identity . ":\n\n" . \
|
message=("This is the daily PSK on " . $Identity . ":\n\n" . \
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification2;
|
:global SendNotification2;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
|
|
@ -74,7 +75,7 @@
|
||||||
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||||
} else={
|
} else={
|
||||||
:local Link ($DailyPskQrCodeUrl . \
|
:local Link ($DailyPskQrCodeUrl . \
|
||||||
"?scale=8&level=1&ssid=" . [ :convert to=url $Ssid ] . "&pass=" . [ :convert to=url $NewPsk ]);
|
"?scale=8&level=1&ssid=" . [ $UrlEncode $Ssid ] . "&pass=" . [ $UrlEncode $NewPsk ]);
|
||||||
$SendNotification2 ({ origin=$ScriptName; \
|
$SendNotification2 ({ origin=$ScriptName; \
|
||||||
subject=([ $SymbolForNotification "calendar" ] . "daily PSK " . $Ssid); \
|
subject=([ $SymbolForNotification "calendar" ] . "daily PSK " . $Ssid); \
|
||||||
message=("This is the daily PSK on " . $Identity . ":\n\n" . \
|
message=("This is the daily PSK on " . $Identity . ":\n\n" . \
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification2;
|
:global SendNotification2;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
|
|
@ -90,7 +91,7 @@
|
||||||
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||||
} else={
|
} else={
|
||||||
:local Link ($DailyPskQrCodeUrl . \
|
:local Link ($DailyPskQrCodeUrl . \
|
||||||
"?scale=8&level=1&ssid=" . [ :convert to=url $Ssid ] . "&pass=" . [ :convert to=url $NewPsk ]);
|
"?scale=8&level=1&ssid=" . [ $UrlEncode $Ssid ] . "&pass=" . [ $UrlEncode $NewPsk ]);
|
||||||
$SendNotification2 ({ origin=$ScriptName; \
|
$SendNotification2 ({ origin=$ScriptName; \
|
||||||
subject=([ $SymbolForNotification "calendar" ] . "daily PSK " . $Ssid); \
|
subject=([ $SymbolForNotification "calendar" ] . "daily PSK " . $Ssid); \
|
||||||
message=("This is the daily PSK on " . $Identity . ":\n\n" . \
|
message=("This is the daily PSK on " . $Identity . ":\n\n" . \
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification2;
|
:global SendNotification2;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
|
|
@ -75,7 +76,7 @@
|
||||||
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||||
} else={
|
} else={
|
||||||
:local Link ($DailyPskQrCodeUrl . \
|
:local Link ($DailyPskQrCodeUrl . \
|
||||||
"?scale=8&level=1&ssid=" . [ :convert to=url $Ssid ] . "&pass=" . [ :convert to=url $NewPsk ]);
|
"?scale=8&level=1&ssid=" . [ $UrlEncode $Ssid ] . "&pass=" . [ $UrlEncode $NewPsk ]);
|
||||||
$SendNotification2 ({ origin=$ScriptName; \
|
$SendNotification2 ({ origin=$ScriptName; \
|
||||||
subject=([ $SymbolForNotification "calendar" ] . "daily PSK " . $Ssid); \
|
subject=([ $SymbolForNotification "calendar" ] . "daily PSK " . $Ssid); \
|
||||||
message=("This is the daily PSK on " . $Identity . ":\n\n" . \
|
message=("This is the daily PSK on " . $Identity . ":\n\n" . \
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,10 @@ hr {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
img.notification {
|
img.notification {
|
||||||
box-shadow: 3px 3px 7px rgba(100,100,100,0.7);
|
box-shadow: 5px 5px 7px gray;
|
||||||
}
|
}
|
||||||
img.screenshot {
|
img.screenshot {
|
||||||
box-shadow: 3px 3px 7px rgba(100,100,100,0.7);
|
box-shadow: 5px 5px 7px gray;
|
||||||
}
|
}
|
||||||
img.logo {
|
img.logo {
|
||||||
float: left;
|
float: left;
|
||||||
|
|
@ -72,7 +72,7 @@ pre {
|
||||||
pre.code {
|
pre.code {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
box-shadow: 3px 3px 7px rgba(100,100,100,0.7);
|
box-shadow: 5px 5px 7px gray;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 6px 10px;
|
padding: 6px 10px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
:global ExitError;
|
:global ExitError;
|
||||||
:global HexToNum;
|
:global HexToNum;
|
||||||
:global UrlEncode;
|
|
||||||
|
|
||||||
# wrapper for $ExitOnError with additional parameter
|
# wrapper for $ExitOnError with additional parameter
|
||||||
:set ExitError do={
|
:set ExitError do={
|
||||||
|
|
@ -37,30 +36,3 @@
|
||||||
|
|
||||||
:return [ :tonum ("0x" . $Input) ];
|
:return [ :tonum ("0x" . $Input) ];
|
||||||
}
|
}
|
||||||
|
|
||||||
# url encoding
|
|
||||||
:set UrlEncode do={
|
|
||||||
:local Input [ :tostr $1 ];
|
|
||||||
|
|
||||||
:if ([ :len $Input ] = 0) do={
|
|
||||||
:return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
:local Return "";
|
|
||||||
:local Chars ("\n\r !\"#\$%&'()*+,:;<=>?@[\\]^`{|}~");
|
|
||||||
:local Subs { "%0A"; "%0D"; "%20"; "%21"; "%22"; "%23"; "%24"; "%25"; "%26"; "%27";
|
|
||||||
"%28"; "%29"; "%2A"; "%2B"; "%2C"; "%3A"; "%3B"; "%3C"; "%3D"; "%3E"; "%3F";
|
|
||||||
"%40"; "%5B"; "%5C"; "%5D"; "%5E"; "%60"; "%7B"; "%7C"; "%7D"; "%7E" };
|
|
||||||
|
|
||||||
:for I from=0 to=([ :len $Input ] - 1) do={
|
|
||||||
:local Char [ :pick $Input $I ];
|
|
||||||
:local Replace [ :find $Chars $Char ];
|
|
||||||
|
|
||||||
:if ([ :typeof $Replace ] = "num") do={
|
|
||||||
:set Char ($Subs->$Replace);
|
|
||||||
}
|
|
||||||
:set Return ($Return . $Char);
|
|
||||||
}
|
|
||||||
|
|
||||||
:return $Return;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@
|
||||||
:global SymbolByUnicodeName;
|
:global SymbolByUnicodeName;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
:global Unix2Dos;
|
:global Unix2Dos;
|
||||||
|
:global UrlEncode;
|
||||||
:global ValidateSyntax;
|
:global ValidateSyntax;
|
||||||
:global VersionToNum;
|
:global VersionToNum;
|
||||||
:global WaitDefaultRouteReachable;
|
:global WaitDefaultRouteReachable;
|
||||||
|
|
@ -1736,6 +1737,33 @@
|
||||||
:return [ :tocrlf [ :tostr $1 ] ];
|
:return [ :tocrlf [ :tostr $1 ] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# url encoding
|
||||||
|
:set UrlEncode do={
|
||||||
|
:local Input [ :tostr $1 ];
|
||||||
|
|
||||||
|
:if ([ :len $Input ] = 0) do={
|
||||||
|
:return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
:local Return "";
|
||||||
|
:local Chars ("\n\r !\"#\$%&'()*+,:;<=>?@[\\]^`{|}~");
|
||||||
|
:local Subs { "%0A"; "%0D"; "%20"; "%21"; "%22"; "%23"; "%24"; "%25"; "%26"; "%27";
|
||||||
|
"%28"; "%29"; "%2A"; "%2B"; "%2C"; "%3A"; "%3B"; "%3C"; "%3D"; "%3E"; "%3F";
|
||||||
|
"%40"; "%5B"; "%5C"; "%5D"; "%5E"; "%60"; "%7B"; "%7C"; "%7D"; "%7E" };
|
||||||
|
|
||||||
|
:for I from=0 to=([ :len $Input ] - 1) do={
|
||||||
|
:local Char [ :pick $Input $I ];
|
||||||
|
:local Replace [ :find $Chars $Char ];
|
||||||
|
|
||||||
|
:if ([ :typeof $Replace ] = "num") do={
|
||||||
|
:set Char ($Subs->$Replace);
|
||||||
|
}
|
||||||
|
:set Return ($Return . $Char);
|
||||||
|
}
|
||||||
|
|
||||||
|
:return $Return;
|
||||||
|
}
|
||||||
|
|
||||||
# basic syntax validation
|
# basic syntax validation
|
||||||
:set ValidateSyntax do={
|
:set ValidateSyntax do={
|
||||||
:local Code [ :tostr $1 ];
|
:local Code [ :tostr $1 ];
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,7 @@
|
||||||
|
|
||||||
:global FetchUserAgentStr;
|
:global FetchUserAgentStr;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
|
:global UrlEncode;
|
||||||
|
|
||||||
:global MatrixAccessToken;
|
:global MatrixAccessToken;
|
||||||
:global MatrixHomeServer;
|
:global MatrixHomeServer;
|
||||||
|
|
@ -250,8 +251,8 @@
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
/tool/fetch check-certificate=yes-without-crl output=none \
|
/tool/fetch check-certificate=yes-without-crl output=none \
|
||||||
http-header-field=({ [ $FetchUserAgentStr $0 ] }) http-method=post http-data="" \
|
http-header-field=({ [ $FetchUserAgentStr $0 ] }) http-method=post http-data="" \
|
||||||
("https://" . $MatrixHomeServer . "/_matrix/client/r0/rooms/" . [ :convert to=url $MatrixRoom ] . \
|
("https://" . $MatrixHomeServer . "/_matrix/client/r0/rooms/" . [ $UrlEncode $MatrixRoom ] . \
|
||||||
"/join?access_token=" . [ :convert to=url $MatrixAccessToken ]) as-value;
|
"/join?access_token=" . [ $UrlEncode $MatrixAccessToken ]) as-value;
|
||||||
$LogPrint debug $0 ("Joined the room.");
|
$LogPrint debug $0 ("Joined the room.");
|
||||||
} do={
|
} do={
|
||||||
$LogPrint error $0 ("Failed joining the room: " . $Err);
|
$LogPrint error $0 ("Failed joining the room: " . $Err);
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
:global UrlEncode;
|
||||||
|
|
||||||
:local Server [ $EitherOr ($NtfyServerOverride->($Notification->"origin")) $NtfyServer ];
|
:local Server [ $EitherOr ($NtfyServerOverride->($Notification->"origin")) $NtfyServer ];
|
||||||
:local User [ $EitherOr ($NtfyServerUserOverride->($Notification->"origin")) $NtfyServerUser ];
|
:local User [ $EitherOr ($NtfyServerUserOverride->($Notification->"origin")) $NtfyServerUser ];
|
||||||
|
|
@ -91,7 +92,7 @@
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:local Url ("https://" . $Server . "/" . [ :convert to=url $Topic ]);
|
:local Url ("https://" . $Server . "/" . [ $UrlEncode $Topic ]);
|
||||||
:local Headers ({ [ $FetchUserAgentStr ($Notification->"origin") ]; \
|
:local Headers ({ [ $FetchUserAgentStr ($Notification->"origin") ]; \
|
||||||
("Priority: " . [ $IfThenElse ($Notification->"silent") "low" "default" ]); \
|
("Priority: " . [ $IfThenElse ($Notification->"silent") "low" "default" ]); \
|
||||||
("Title: " . "[" . $IdentityExtra . $Identity . "] " . ($Notification->"subject")) });
|
("Title: " . "[" . $IdentityExtra . $Identity . "] " . ($Notification->"subject")) });
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global ProtocolStrip;
|
:global ProtocolStrip;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
:global UrlEncode;
|
||||||
|
|
||||||
:local EscapeMD do={
|
:local EscapeMD do={
|
||||||
:local Text [ :tostr $1 ];
|
:local Text [ :tostr $1 ];
|
||||||
|
|
@ -202,7 +203,7 @@
|
||||||
}
|
}
|
||||||
:local Data ([ /tool/fetch check-certificate=yes-without-crl output=user http-method=post \
|
:local Data ([ /tool/fetch check-certificate=yes-without-crl output=user http-method=post \
|
||||||
("https://api.telegram.org/bot" . $TokenId . "/sendMessage") \
|
("https://api.telegram.org/bot" . $TokenId . "/sendMessage") \
|
||||||
http-data=($HTTPData . "&text=" . [ :convert to=url $Text ]) as-value ]->"data");
|
http-data=($HTTPData . "&text=" . [ $UrlEncode $Text ]) as-value ]->"data");
|
||||||
:set ($TelegramMessageIDs->[ :tostr ([ :deserialize from=json value=$Data ]->"result"->"message_id") ]) 1;
|
:set ($TelegramMessageIDs->[ :tostr ([ :deserialize from=json value=$Data ]->"result"->"message_id") ]) 1;
|
||||||
} do={
|
} do={
|
||||||
$LogPrint info $0 ("Failed sending Telegram notification: " . $Err . " - Queuing...");
|
$LogPrint info $0 ("Failed sending Telegram notification: " . $Err . " - Queuing...");
|
||||||
|
|
@ -214,7 +215,7 @@
|
||||||
[ $EscapeMD ("This message was queued since _" . [ /system/clock/get date ] . \
|
[ $EscapeMD ("This message was queued since _" . [ /system/clock/get date ] . \
|
||||||
" " . [ /system/clock/get time ] . "_ and may be obsolete.") "plain" "_" ]);
|
" " . [ /system/clock/get time ] . "_ and may be obsolete.") "plain" "_" ]);
|
||||||
:set ($TelegramQueue->[ :len $TelegramQueue ]) { tokenid=$TokenId;
|
:set ($TelegramQueue->[ :len $TelegramQueue ]) { tokenid=$TokenId;
|
||||||
http-data=($HTTPData . "&text=" . [ :convert to=url $Text ]) };
|
http-data=($HTTPData . "&text=" . [ $UrlEncode $Text ]) };
|
||||||
:if ([ :len [ /system/scheduler/find where name="_FlushTelegramQueue" ] ] = 0) do={
|
:if ([ :len [ /system/scheduler/find where name="_FlushTelegramQueue" ] ] = 0) do={
|
||||||
/system/scheduler/add name="_FlushTelegramQueue" interval=1m start-time=startup \
|
/system/scheduler/add name="_FlushTelegramQueue" interval=1m start-time=startup \
|
||||||
on-event=(":global FlushTelegramQueue; \$FlushTelegramQueue;");
|
on-event=(":global FlushTelegramQueue; \$FlushTelegramQueue;");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue