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.
This commit is contained in:
Christian Hesse 2023-09-13 15:38:31 +02:00
parent 46e48497d5
commit 110bb793b6

View file

@ -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 " . \