mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-routeros-update: support update from specific neighbor(s)
... by matching the identity property.
This commit is contained in:
parent
49d85c6def
commit
7b47ed7ea5
5 changed files with 8 additions and 2 deletions
|
@ -13,6 +13,7 @@
|
||||||
:global Identity;
|
:global Identity;
|
||||||
:global SafeUpdateAll;
|
:global SafeUpdateAll;
|
||||||
:global SafeUpdateNeighbor;
|
:global SafeUpdateNeighbor;
|
||||||
|
:global SafeUpdateNeighborIdentity;
|
||||||
:global SafeUpdatePatch;
|
:global SafeUpdatePatch;
|
||||||
:global SafeUpdateUrl;
|
:global SafeUpdateUrl;
|
||||||
:global SentRouterosUpdateNotification;
|
:global SentRouterosUpdateNotification;
|
||||||
|
@ -81,7 +82,8 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ($SafeUpdateNeighbor = true && [ :len [ /ip/neighbor/find where platform="MikroTik" \
|
: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;
|
$LogPrintExit2 info $0 ("Seen a neighbor running version " . $Update->"latest-version" . ", updating...") false;
|
||||||
$SendNotification2 ({ origin=$0; \
|
$SendNotification2 ({ origin=$0; \
|
||||||
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \
|
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \
|
||||||
|
|
|
@ -52,6 +52,8 @@ The configuration goes to `global-config-overlay`, these are the parameters:
|
||||||
|
|
||||||
* `SafeUpdateNeighbor`: install updates automatically if at least one other
|
* `SafeUpdateNeighbor`: install updates automatically if at least one other
|
||||||
device is seen in neighbor list with new version
|
device is seen in neighbor list with new version
|
||||||
|
* `SafeUpdateNeighborIdentity`: regular expression to match identity for
|
||||||
|
trusted devices, leave empty to match all
|
||||||
* `SafeUpdatePatch`: install patch updates (where just last digit changes)
|
* `SafeUpdatePatch`: install patch updates (where just last digit changes)
|
||||||
automatically
|
automatically
|
||||||
* `SafeUpdateUrl`: url on webserver to check for safe update, the channel
|
* `SafeUpdateUrl`: url on webserver to check for safe update, the channel
|
||||||
|
|
|
@ -126,6 +126,7 @@
|
||||||
:global SafeUpdatePatch false;
|
:global SafeUpdatePatch false;
|
||||||
# Allow to install updates automatically if seen in neighbor list.
|
# Allow to install updates automatically if seen in neighbor list.
|
||||||
:global SafeUpdateNeighbor false;
|
:global SafeUpdateNeighbor false;
|
||||||
|
:global SafeUpdateNeighborIdentity "";
|
||||||
# Install *ALL* updates automatically!
|
# Install *ALL* updates automatically!
|
||||||
# Set to all upper-case "Yes, please!" to enable.
|
# Set to all upper-case "Yes, please!" to enable.
|
||||||
:global SafeUpdateAll "no";
|
:global SafeUpdateAll "no";
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
:local 0 "global-functions";
|
:local 0 "global-functions";
|
||||||
|
|
||||||
# expected configuration version
|
# expected configuration version
|
||||||
:global ExpectedConfigVersion 104;
|
:global ExpectedConfigVersion 105;
|
||||||
|
|
||||||
# global variables not to be changed by user
|
# global variables not to be changed by user
|
||||||
:global GlobalFunctionsReady false;
|
:global GlobalFunctionsReady false;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
102="Modified 'hotspot-to-wpa' to support non-local (radius) users.";
|
102="Modified 'hotspot-to-wpa' to support non-local (radius) users.";
|
||||||
103="Dropped hard-coded name and timeout from 'hotspot-to-wpa-cleanup', instead a comment is required for dhcp server now.";
|
103="Dropped hard-coded name and timeout from 'hotspot-to-wpa-cleanup', instead a comment is required for dhcp server now.";
|
||||||
104="All relevant scripts were ported to new wifiwave2 and are available for AX devices now!";
|
104="All relevant scripts were ported to new wifiwave2 and are available for AX devices now!";
|
||||||
|
105="Extended 'check-routeros-update' to support automatic update from specific neighbor(s).";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Migration steps to be applied on script updates
|
# Migration steps to be applied on script updates
|
||||||
|
|
Loading…
Reference in a new issue