Browse Source

check-routeros-update: allow update for cap

If CAPsMAN is running on a device with just 16MB flash downloading the
packages is not possible (or at least lost at reboot). So allow a CAP to
update with opt-in.
pull/15/head change-59
Michael Gisbers 3 months ago
committed by Christian Hesse
parent
commit
d5edcbd3b6
  1. 4
      check-routeros-update
  2. 1
      doc/check-routeros-update.md
  3. 4
      global-config
  4. 2
      global-config-overlay
  5. 1
      global-config.changes
  6. 2
      global-functions

4
check-routeros-update

@ -12,6 +12,7 @@
:global Identity;
:global SafeUpdateNeighbor;
:global SafeUpdateOnCap;
:global SafeUpdatePatch;
:global SafeUpdateUrl;
:global SentRouterosUpdateNotification;
@ -37,7 +38,8 @@ $WaitFullyConnected;
:if ([ :len [ / system package find where name="wireless" disabled=no ] ] > 0) do={
:if ([ / interface wireless cap get enabled ] = true && \
[ / caps-man manager get enabled ] = false) do={
[ / caps-man manager get enabled ] = false && \
$SafeUpdateOnCap != true) do={
$LogPrintExit2 error $0 ("System is managed by CAPsMAN, not checking for RouterOS version.") true;
}
}

1
doc/check-routeros-update.md

@ -42,6 +42,7 @@ safe versions from a web server. The configuration goes to
`global-config-overlay`, this is the parameter:
* `SafeUpdateNeighbor`: install updates automatically if seen in neighbor list
* `SafeUpdateOnCap`: check for updates even if device is managed by CAPsMAN
* `SafeUpdatePatch`: install patch updates automatically
* `SafeUpdateUrl`: url to check for safe update, the channel (`long-term`,
`stable` or `testing`) is appended

4
global-config

@ -8,7 +8,7 @@
# Make sure all configuration properties are up to date and this
# value is in sync with value in script 'global-functions'!
:global GlobalConfigVersion 58;
:global GlobalConfigVersion 59;
# This is used for DNS and backup file.
:global Domain "example.com";
@ -92,6 +92,8 @@
:global SafeUpdatePatch false;
# Allow to install updates automatically if seen in neighbor list.
:global SafeUpdateNeighbor false;
# Allow to install updates even if device is managed by CAPsMAN.
:global SafeUpdateOnCap false;
# These thresholds control when to send health notification
# on temperature and voltage.

2
global-config-overlay

@ -8,7 +8,7 @@
# Make sure all configuration properties are up to date and this
# value is in sync with value in script 'global-functions'!
# Comment or remove to disable news and change notifications.
:global GlobalConfigVersion 58;
:global GlobalConfigVersion 59;
# Copy configuration from global-config here and modify it.

1
global-config.changes

@ -62,6 +62,7 @@
56="Added tags in all backup, lease and ppp-on-up scripts. These are used by 'packages-update', 'lease-script' and 'ppp-on-up' to find the scripts.";
57="Celebrating the 1.000th commit - Hooray!";
58="Added a cleanup script for 'hotspot-to-wpa' to purge old access list entries.";
59="Updating CAP with 'check-routeros-update' is now possible with opt-in.";
};
# Migration steps to be applied on script updates

2
global-functions

@ -8,7 +8,7 @@
# https://git.eworm.de/cgit/routeros-scripts/about/
# expected configuration version
:global ExpectedConfigVersion 58;
:global ExpectedConfigVersion 59;
# global variables not to be changed by user
:global GlobalFunctionsReady false;

Loading…
Cancel
Save