aboutsummaryrefslogtreecommitdiffstats
path: root/check-routeros-update.rsc
diff options
context:
space:
mode:
authorGravatar Ben Harris <mail@bharr.is>2023-07-13 09:38:20 +0800
committerGravatar Christian Hesse <mail@eworm.de>2023-07-13 08:00:14 +0200
commitfbf55292a4fa15cbd06490b66509884f62f78dbc (patch)
tree845ec1673568de118742b62e5bfb88d8f671b9a0 /check-routeros-update.rsc
parent313e026229932e4988d3ce96d69ddb8ab5f1b934 (diff)
check-routeros-update: match version with date suffix
Neighbor version can have a date suffix. This changes to match only on the beginning. Closes: GH-45 Co-authored-by: Christian Hesse <mail@eworm.de>
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"); \