diff options
author | Christian Hesse <mail@eworm.de> | 2020-11-01 21:48:03 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-11-01 21:48:03 +0100 |
commit | 98c132105dc88b13989c12d5bf9572022c7e986b (patch) | |
tree | 0bbd37192fe19e9605afb9532c549e1a5fbcfb0b /check-routeros-update | |
parent | 7f356d76bf5c76d98d3fc93c6471720b49750daf (diff) |
check-routeros-update: support installing updates automatically if seen in neighbor listchange-36
Diffstat (limited to 'check-routeros-update')
-rw-r--r-- | check-routeros-update | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/check-routeros-update b/check-routeros-update index 13262f3..e020153 100644 --- a/check-routeros-update +++ b/check-routeros-update @@ -7,8 +7,9 @@ # https://git.eworm.de/cgit/routeros-scripts/about/doc/check-routeros-update.md :global Identity; -:global SafeUpdateUrl; +:global SafeUpdateNeighbor; :global SafeUpdatePatch; +:global SafeUpdateUrl; :global SentRouterosUpdateNotification; :global DeviceInfo; @@ -57,6 +58,15 @@ $DoUpdate; } + :if ($SafeUpdateNeighbor = true && [ :len [ / ip neighbor find where \ + version=($Update->"latest-version" . " (" . $Update->"channel" . ")") ] ] > 0) do={ + $LogPrintExit info ("Seen a neighbor running version " . $Update->"latest-version" . ", updating...") false; + $SendNotification ([ $SymbolForNotification "sparkles" ] . "RouterOS update") \ + ("Seen a neighbor running version " . $Update->"latest-version" . " from " . $Update->"channel" . \ + ", updating on " . $Identity . "...") "" "true"; + $DoUpdate; + } + :if ([ :len $SafeUpdateUrl ] > 0) do={ :local Result; :do { |