aboutsummaryrefslogtreecommitdiffstats
path: root/check-routeros-update.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'check-routeros-update.rsc')
-rw-r--r--check-routeros-update.rsc3
1 files changed, 2 insertions, 1 deletions
diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc
index 1405d4e..c46dc7d 100644
--- a/check-routeros-update.rsc
+++ b/check-routeros-update.rsc
@@ -18,6 +18,7 @@
:global SentRouterosUpdateNotification;
:global DeviceInfo;
+:global EscapeForRegEx;
:global LogPrintExit2;
:global ScriptFromTerminal;
:global ScriptLock;
@@ -80,7 +81,7 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false;
}
:if ($SafeUpdateNeighbor = true && [ :len [ /ip/neighbor/find where \
- version=($Update->"latest-version" . " (" . $Update->"channel" . ")") ] ] > 0) do={
+ version~("^" . [ $EscapeForRegEx ($Update->"latest-version" . " (" . $Update->"channel" . ")") ]) ] ] > 0) do={
$LogPrintExit2 info $0 ("Seen a neighbor running version " . $Update->"latest-version" . ", updating...") false;
$SendNotification2 ({ origin=$0; \
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \