mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-22 00:49:34 +00:00
sms-forward: early exit with :exit
This commit is contained in:
parent
4066ce4b96
commit
ac8daa4da4
1 changed files with 4 additions and 8 deletions
|
|
@ -9,7 +9,6 @@
|
||||||
# forward SMS to e-mail
|
# forward SMS to e-mail
|
||||||
# https://rsc.eworm.de/doc/sms-forward.md
|
# https://rsc.eworm.de/doc/sms-forward.md
|
||||||
|
|
||||||
:local ExitOK false;
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||||
|
|
@ -29,14 +28,12 @@
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ /tool/sms/get receive-enabled ] = false) do={
|
:if ([ /tool/sms/get receive-enabled ] = false) do={
|
||||||
$LogPrintOnce warning $ScriptName ("Receiving of SMS is not enabled.");
|
$LogPrintOnce warning $ScriptName ("Receiving of SMS is not enabled.");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$WaitFullyConnected;
|
$WaitFullyConnected;
|
||||||
|
|
@ -45,8 +42,7 @@
|
||||||
|
|
||||||
:if ([ /interface/lte/get ($Settings->"port") running ] != true) do={
|
:if ([ /interface/lte/get ($Settings->"port") running ] != true) do={
|
||||||
$LogPrint info $ScriptName ("The LTE interface is not in running state, skipping.");
|
$LogPrint info $ScriptName ("The LTE interface is not in running state, skipping.");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# forward SMS in a loop
|
# forward SMS in a loop
|
||||||
|
|
@ -107,5 +103,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} do={
|
} do={
|
||||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue