From 70f9c7926b31d7d7e4e48157e83e0e3acf8352e0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 8 Sep 2021 14:33:02 +0200 Subject: 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... --- global-functions | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'global-functions') diff --git a/global-functions b/global-functions index 30512f6..e6b6527 100644 --- a/global-functions +++ b/global-functions @@ -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" }; -- cgit v1.2.3-70-g09d2