mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-24 02:28:39 +02:00
sms-action: use $ValidateSyntax
This commit is contained in:
parent
8e00545267
commit
e76b52e3b0
1 changed files with 8 additions and 5 deletions
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;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue