From 110bb793b66b1f195eddd0480416b688b8af1a48 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Sep 2023 15:38:31 +0200 Subject: check-routeros-update: do not match the channel on neighbor update While this works for stable, it does not for testing: The testing channel can have "testing" in the string for rc releases, but also "development" for beta releases... and possibly more. Instead match on version string only, with word boundary. --- check-routeros-update.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'check-routeros-update.rsc') diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 73ce7d8..d77164d 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -83,7 +83,7 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; :if ($SafeUpdateNeighbor = true) do={ :local Neighbors [ /ip/neighbor/find where platform="MikroTik" identity~$SafeUpdateNeighborIdentity \ - version~("^" . [ $EscapeForRegEx ($Update->"latest-version" . " (" . $Update->"channel" . ")") ]) ]; + version~("^" . [ $EscapeForRegEx ($Update->"latest-version") ] . "\\b") ]; :if ([ :len $Neighbors ] > 0) do={ :local Neighbor [ /ip/neighbor/get ($Neighbors->0) identity ]; $LogPrintExit2 info $0 ("Seen a neighbor (" . $Neighbor . ") running version " . \ -- cgit v1.2.3-54-g00ecf