From 7b47ed7ea5a937edef9699c1b8be3b6364c9c0c9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 17 Aug 2023 09:06:44 +0200 Subject: check-routeros-update: support update from specific neighbor(s) ... by matching the identity property. --- check-routeros-update.rsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'check-routeros-update.rsc') diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index b328d4c..0625ebd 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -13,6 +13,7 @@ :global Identity; :global SafeUpdateAll; :global SafeUpdateNeighbor; +:global SafeUpdateNeighborIdentity; :global SafeUpdatePatch; :global SafeUpdateUrl; :global SentRouterosUpdateNotification; @@ -81,7 +82,8 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; } :if ($SafeUpdateNeighbor = true && [ :len [ /ip/neighbor/find where platform="MikroTik" \ - version~("^" . [ $EscapeForRegEx ($Update->"latest-version" . " (" . $Update->"channel" . ")") ]) ] ] > 0) do={ + version~("^" . [ $EscapeForRegEx ($Update->"latest-version" . " (" . $Update->"channel" . ")") ]) \ + identity~$SafeUpdateNeighborIdentity ] ] > 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"); \ -- cgit v1.2.3-54-g00ecf