mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
check-routeros-update: support installing updates automatically if seen in neighbor list
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user