From eab87e4d60898e64efe44c49a07526906910816b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 23 Mar 2023 13:51:52 +0100 Subject: sms-forward: add workaround to fix removal of messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removal of messages is broken in RouterOS 7.8: [admin@MikroTik] > /tool/sms/inbox/remove [ find ] failure: Interface not running! Of course the interface is running. Toggling the auto-erase setting fixes this until next boot. So let's add a workaround... Reported to support (SUP-110828), but not (yet) acknowledged. 🤨 --- sms-forward.rsc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sms-forward.rsc b/sms-forward.rsc index 802da48..74b1b31 100644 --- a/sms-forward.rsc +++ b/sms-forward.rsc @@ -13,9 +13,11 @@ :global Identity; :global SmsForwardHooks; +:global SmsForwardWorkaround; :global IfThenElse; :global LogPrintExit2; +:global RequiredRouterOS; :global ScriptLock; :global SendNotification2; :global SymbolForNotification; @@ -28,6 +30,14 @@ $ScriptLock $0; $LogPrintExit2 warning $0 ("Receiving of SMS is not enabled.") true; } +:if ($SmsForwardWorkaround != true && \ + [ $RequiredRouterOS $0 "7.8" false ] = true) do={ + :local AutoErase [ /tool/sms/get auto-erase ]; + /tool/sms/set auto-erase=(!$AutoErase); + /tool/sms/set auto-erase=$AutoErase; + :set SmsForwardWorkaround true; +} + $WaitFullyConnected; :local Settings [ /tool/sms/get ]; -- cgit v1.2.3-54-g00ecf