mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
sms-action: use $ValidateSyntax
This commit is contained in:
13
sms-action
13
sms-action
@ -13,6 +13,7 @@
|
|||||||
:global SmsAction;
|
:global SmsAction;
|
||||||
|
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
:global ValidateSyntax;
|
||||||
|
|
||||||
:local Action $action;
|
:local Action $action;
|
||||||
|
|
||||||
@ -21,8 +22,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:local Code ($SmsAction->$Action);
|
:local Code ($SmsAction->$Action);
|
||||||
:local Parsed [ :parse $Code ];
|
:if ([ $ValidateSyntax $Code ] = true) do={
|
||||||
|
:log info ("Acting on SMS action '" . $Action . "': " . $Code);
|
||||||
:log info ("Acting on SMS action '" . $Action . "': " . $Code);
|
:delay 1s;
|
||||||
:delay 1s;
|
[ :parse $Code ];
|
||||||
$Parsed;
|
} else={
|
||||||
|
$LogPrintExit2 warning $0 ("The code for action '" . $Action . "' failed syntax validation!") false;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user