mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-routeros-update: allow to install all updates automatically...
... but with extra hurdle for more awareness of danger. Let's not send a new notification, intentionally. This feature is dangerous, and we should not advertise it.
This commit is contained in:
parent
a9741336b8
commit
d2d913ec19
|
@ -11,6 +11,7 @@
|
||||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
:global SafeUpdateAll;
|
||||||
:global SafeUpdateNeighbor;
|
:global SafeUpdateNeighbor;
|
||||||
:global SafeUpdatePatch;
|
:global SafeUpdatePatch;
|
||||||
:global SafeUpdateUrl;
|
:global SafeUpdateUrl;
|
||||||
|
@ -59,6 +60,16 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ($NumInstalled < $NumLatest) do={
|
:if ($NumInstalled < $NumLatest) do={
|
||||||
|
:if ($SafeUpdateAll ~ "^YES,? ?PLEASE!?\$") do={
|
||||||
|
$LogPrintExit2 info $0 ("Installing ALL versions automatically, including " . \
|
||||||
|
$Update->"latest-version" . "...") false;
|
||||||
|
$SendNotification2 ({ origin=$0; \
|
||||||
|
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \
|
||||||
|
message=("Installing ALL versions automatically, including " . $Update->"latest-version" . \
|
||||||
|
"... Updating on " . $Identity . "..."); link=$Link; silent=true });
|
||||||
|
$DoUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
:if ($SafeUpdatePatch = true && ($NumInstalled & 0xffff0000) = ($NumLatest & 0xffff0000)) do={
|
:if ($SafeUpdatePatch = true && ($NumInstalled & 0xffff0000) = ($NumLatest & 0xffff0000)) do={
|
||||||
$LogPrintExit2 info $0 ("Version " . $Update->"latest-version" . " is a patch release, updating...") false;
|
$LogPrintExit2 info $0 ("Version " . $Update->"latest-version" . " is a patch release, updating...") false;
|
||||||
$SendNotification2 ({ origin=$0; \
|
$SendNotification2 ({ origin=$0; \
|
||||||
|
|
|
@ -56,6 +56,10 @@ The configuration goes to `global-config-overlay`, these are the parameters:
|
||||||
automatically
|
automatically
|
||||||
* `SafeUpdateUrl`: url on webserver to check for safe update, the channel
|
* `SafeUpdateUrl`: url on webserver to check for safe update, the channel
|
||||||
(`long-term`, `stable` or `testing`) is appended
|
(`long-term`, `stable` or `testing`) is appended
|
||||||
|
* `SafeUpdateAll`: install **all** updates automatically
|
||||||
|
|
||||||
|
> ℹ️ **Info**: Installing **all** updates automatically requires extra
|
||||||
|
> confirmation. See `global-config` for details.
|
||||||
|
|
||||||
Also notification settings are required for
|
Also notification settings are required for
|
||||||
[e-mail](mod/notification-email.md),
|
[e-mail](mod/notification-email.md),
|
||||||
|
|
|
@ -105,6 +105,9 @@
|
||||||
: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;
|
||||||
|
# Install *ALL* updates automatically!
|
||||||
|
# Set to all upper-case "Yes, please!" to enable.
|
||||||
|
:global SafeUpdateAll "no";
|
||||||
|
|
||||||
# These thresholds control when to send health notification
|
# These thresholds control when to send health notification
|
||||||
# on temperature and voltage.
|
# on temperature and voltage.
|
||||||
|
|
Loading…
Reference in a new issue