mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-20 16:09:32 +00:00
sms-action: early exit with :exit
This commit is contained in:
parent
19a8ae84ed
commit
4066ce4b96
1 changed files with 2 additions and 4 deletions
|
|
@ -8,7 +8,6 @@
|
|||
# run action on received SMS
|
||||
# https://rsc.eworm.de/doc/sms-action.md
|
||||
|
||||
:local ExitOK false;
|
||||
:onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
|
|
@ -24,8 +23,7 @@
|
|||
|
||||
:if ([ :typeof $Action ] = "nothing") do={
|
||||
$LogPrint error $ScriptName ("This script is supposed to run from SMS hook with action=...");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:local Code ($SmsAction->$Action);
|
||||
|
|
@ -37,5 +35,5 @@
|
|||
$LogPrint warning $ScriptName ("The code for action '" . $Action . "' failed syntax validation!");
|
||||
}
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue