sms-forward: drop workaround, add required RouterOS

This commit is contained in:
Christian Hesse 2023-03-28 15:55:48 +02:00
parent c8500dddd0
commit 1f1e76b822
2 changed files with 4 additions and 11 deletions

View file

@ -3,6 +3,8 @@ Forward received SMS
[⬅️ Go back to main README](../README.md) [⬅️ Go back to main README](../README.md)
![required RouterOS version](https://img.shields.io/badge/RouterOS-7.9beta4-yellow?style=flat)
> **Info**: This script can not be used on its own but requires the base > **Info**: This script can not be used on its own but requires the base
> installation. See [main README](../README.md) for details. > installation. See [main README](../README.md) for details.

View file

@ -4,6 +4,8 @@
# Anatoly Bubenkov <bubenkoff@gmail.com> # Anatoly Bubenkov <bubenkoff@gmail.com>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
# #
# requires RouterOS, version=7.9beta4
#
# forward SMS to e-mail # forward SMS to e-mail
# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-forward.md # https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-forward.md
@ -13,11 +15,9 @@
:global Identity; :global Identity;
:global SmsForwardHooks; :global SmsForwardHooks;
:global SmsForwardWorkaround;
:global IfThenElse; :global IfThenElse;
:global LogPrintExit2; :global LogPrintExit2;
:global RequiredRouterOS;
:global ScriptLock; :global ScriptLock;
:global SendNotification2; :global SendNotification2;
:global SymbolForNotification; :global SymbolForNotification;
@ -30,15 +30,6 @@ $ScriptLock $0;
$LogPrintExit2 warning $0 ("Receiving of SMS is not enabled.") true; $LogPrintExit2 warning $0 ("Receiving of SMS is not enabled.") true;
} }
:if ($SmsForwardWorkaround != true && \
[ $RequiredRouterOS $0 "7.8" false ] = true && \
[ $RequiredRouterOS $0 "7.9beta4" false ] = false) do={
:local AutoErase [ /tool/sms/get auto-erase ];
/tool/sms/set auto-erase=(!$AutoErase);
/tool/sms/set auto-erase=$AutoErase;
:set SmsForwardWorkaround true;
}
$WaitFullyConnected; $WaitFullyConnected;
:local Settings [ /tool/sms/get ]; :local Settings [ /tool/sms/get ];