mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions*: syntax for ROS 7.x
Strings with escape sequence have to be enclosed in parentheses. Looks like RouterOS 7.x is stricter here...
This commit is contained in:
@ -310,7 +310,7 @@
|
||||
}
|
||||
|
||||
:local Return "";
|
||||
:local Chars "^.[]\$()|*+\?{}\\";
|
||||
:local Chars ("^.[]\$()|*+\?{}\\");
|
||||
|
||||
:for I from=0 to=([ :len $Input ] - 1) do={
|
||||
:local Char [ :pick $Input $I ];
|
||||
@ -503,7 +503,7 @@
|
||||
}
|
||||
|
||||
:local Log ($Name . ": " . $Message);
|
||||
:if ($Severity ~ "^(debug|error|info)\$") do={
|
||||
:if ($Severity ~ ("^(debug|error|info)\$")) do={
|
||||
:if ($Severity = "debug") do={ :log debug $Log; }
|
||||
:if ($Severity = "error") do={ :log error $Log; }
|
||||
:if ($Severity = "info" ) do={ :log info $Log; }
|
||||
@ -588,7 +588,7 @@
|
||||
attach=($Notification->"attach"); remove-attach=($Notification->"remove-attach") };
|
||||
:if ([ :len [ / system scheduler find where name="FlushEmailQueue" ] ] = 0) do={
|
||||
/ system scheduler add name=FlushEmailQueue interval=1s start-time=startup \
|
||||
on-event=":global FlushEmailQueue; \$FlushEmailQueue;";
|
||||
on-event=(":global FlushEmailQueue; \$FlushEmailQueue;");
|
||||
}
|
||||
}
|
||||
|
||||
@ -666,7 +666,7 @@
|
||||
|
||||
:if ([ $VersionToNum $Required ] > [ $VersionToNum [ / system package update get installed-version ] ]) do={
|
||||
:if ($Warn = true) do={
|
||||
$LogPrintExit2 warning $0 ("This " . [ $IfThenElse ([ :pick $Caller 0 ] = "\$") "function" "script" ] . \
|
||||
$LogPrintExit2 warning $0 ("This " . [ $IfThenElse ([ :pick $Caller 0 ] = ("\$")) "function" "script" ] . \
|
||||
" '" . $Caller . "' (at least specific functionality) requires RouterOS " . $Required . ". Please update!") false;
|
||||
}
|
||||
:return false;
|
||||
@ -782,7 +782,7 @@
|
||||
:if ($ScriptVal->"name" = "global-config") do={
|
||||
:set ReloadGlobalConfig true;
|
||||
}
|
||||
:if ($ScriptVal->"name" ~ "^global-functions(\$|\\.d/.)") do={
|
||||
:if ($ScriptVal->"name" ~ ("^global-functions(\$|\\.d/.)")) do={
|
||||
:set ReloadGlobalFunctions true;
|
||||
}
|
||||
} else={
|
||||
@ -1183,7 +1183,7 @@
|
||||
}
|
||||
|
||||
:local Return "";
|
||||
:local Chars "\n\r !\"#\$%&'()*+,:;<=>\?@[\\]^`{|}~";
|
||||
: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" };
|
||||
|
@ -135,7 +135,7 @@
|
||||
plain=$Plain; formatted=$Formatted };
|
||||
:if ([ :len [ / system scheduler find where name="FlushMatrixQueue" ] ] = 0) do={
|
||||
/ system scheduler add name=FlushMatrixQueue interval=1m start-time=startup \
|
||||
on-event=":global FlushMatrixQueue; \$FlushMatrixQueue;";
|
||||
on-event=(":global FlushMatrixQueue; \$FlushMatrixQueue;");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@
|
||||
parsemode=$ParseMode; text=$Text; silent=($Notification->"silent") };
|
||||
:if ([ :len [ / system scheduler find where name="FlushTelegramQueue" ] ] = 0) do={
|
||||
/ system scheduler add name=FlushTelegramQueue interval=1m start-time=startup \
|
||||
on-event=":global FlushTelegramQueue; \$FlushTelegramQueue;";
|
||||
on-event=(":global FlushTelegramQueue; \$FlushTelegramQueue;");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user