aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-03-03 14:15:24 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-03-06 21:06:48 +0100
commitd2d913ec19c0395fdc1090bb8baaf911d79dbab0 (patch)
tree8ec9bb795b4eba3802a49151e311e740d78f8223
parenta9741336b89a41a8cbf252c799ef3926b268b6e0 (diff)
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.
-rw-r--r--check-routeros-update11
-rw-r--r--doc/check-routeros-update.md4
-rw-r--r--global-config3
3 files changed, 18 insertions, 0 deletions
diff --git a/check-routeros-update b/check-routeros-update
index 3e5a381..d1c82c5 100644
--- a/check-routeros-update
+++ b/check-routeros-update
@@ -11,6 +11,7 @@
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
:global Identity;
+:global SafeUpdateAll;
:global SafeUpdateNeighbor;
:global SafeUpdatePatch;
:global SafeUpdateUrl;
@@ -59,6 +60,16 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false;
}
: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={
$LogPrintExit2 info $0 ("Version " . $Update->"latest-version" . " is a patch release, updating...") false;
$SendNotification2 ({ origin=$0; \
diff --git a/doc/check-routeros-update.md b/doc/check-routeros-update.md
index 8eec19b..8e158e1 100644
--- a/doc/check-routeros-update.md
+++ b/doc/check-routeros-update.md
@@ -56,6 +56,10 @@ The configuration goes to `global-config-overlay`, these are the parameters:
automatically
* `SafeUpdateUrl`: url on webserver to check for safe update, the channel
(`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
[e-mail](mod/notification-email.md),
diff --git a/global-config b/global-config
index c65e2f0..770efd0 100644
--- a/global-config
+++ b/global-config
@@ -105,6 +105,9 @@
:global SafeUpdatePatch false;
# Allow to install updates automatically if seen in neighbor list.
: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
# on temperature and voltage.