mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-04-17 18:49:37 +00:00
sms-forward: early exit with :exit
This commit is contained in:
parent
01467ce142
commit
76f84bd525
2 changed files with 6 additions and 10 deletions
|
|
@ -4,7 +4,7 @@ Forward received SMS
|
||||||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||||
[](https://mikrotik.com/download/changelogs/)
|
[](https://mikrotik.com/download/changelogs/)
|
||||||
[](https://t.me/routeros_scripts)
|
[](https://t.me/routeros_scripts)
|
||||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,11 @@
|
||||||
# Anatoly Bubenkov <bubenkoff@gmail.com>
|
# Anatoly Bubenkov <bubenkoff@gmail.com>
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.19
|
# requires RouterOS, version=7.22
|
||||||
#
|
#
|
||||||
# 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 ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue