mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-13 19:44:28 +02:00
parent
98f26989f5
commit
62f33d7b19
5 changed files with 24 additions and 1 deletions
|
@ -34,6 +34,18 @@ Just install the script:
|
||||||
It is automatically run by [check-routeros-update](check-routeros-update.md)
|
It is automatically run by [check-routeros-update](check-routeros-update.md)
|
||||||
if available.
|
if available.
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The configuration goes to `global-config-overlay`, this is the only parameter:
|
||||||
|
|
||||||
|
* `PackagesUpdateDeferReboot`: defer the reboot for night (between 3 AM
|
||||||
|
and 4 AM)
|
||||||
|
|
||||||
|
> ℹ️ **Info**: Copy relevant configuration from
|
||||||
|
> [`global-config`](../global-config.rsc) (the one without `-overlay`) to
|
||||||
|
> your local `global-config-overlay` and modify it to your specific needs.
|
||||||
|
|
||||||
Usage and invocation
|
Usage and invocation
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,9 @@
|
||||||
# Set to all upper-case "Yes, please!" to enable.
|
# Set to all upper-case "Yes, please!" to enable.
|
||||||
:global SafeUpdateAll "no";
|
:global SafeUpdateAll "no";
|
||||||
|
|
||||||
|
# Defer the reboot for night on automatic (non-interactive) update
|
||||||
|
:global PackagesUpdateDeferReboot false;
|
||||||
|
|
||||||
# These thresholds control when to send health notification
|
# These thresholds control when to send health notification
|
||||||
# on temperature and voltage.
|
# on temperature and voltage.
|
||||||
:global CheckHealthTemperature {
|
:global CheckHealthTemperature {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
:local 0 "global-functions";
|
:local 0 "global-functions";
|
||||||
|
|
||||||
# expected configuration version
|
# expected configuration version
|
||||||
:global ExpectedConfigVersion 116;
|
:global ExpectedConfigVersion 117;
|
||||||
|
|
||||||
# global variables not to be changed by user
|
# global variables not to be changed by user
|
||||||
:global GlobalFunctionsReady false;
|
:global GlobalFunctionsReady false;
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
116=("... and also please keep in mind that it takes a huge amount of time maintaining these scripts. " . [ $IfThenElse ($IDonate != true) \
|
116=("... and also please keep in mind that it takes a huge amount of time maintaining these scripts. " . [ $IfThenElse ($IDonate != true) \
|
||||||
("Following the donation hint " . [ $SymbolForNotification "arrow-down" "below" ] . "to keep me motivated is much appreciated. Thanks!") \
|
("Following the donation hint " . [ $SymbolForNotification "arrow-down" "below" ] . "to keep me motivated is much appreciated. Thanks!") \
|
||||||
("Looks like you did donate already. " . [ $SymbolForNotification "heart" "<3" ] . "Much appreciated, thanks!") ]);
|
("Looks like you did donate already. " . [ $SymbolForNotification "heart" "<3" ] . "Much appreciated, thanks!") ]);
|
||||||
|
117="Enhanced 'packages-update' to support deferred reboot on automatically installed updates.";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Migration steps to be applied on script updates
|
# Migration steps to be applied on script updates
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global VersionToNum;
|
:global VersionToNum;
|
||||||
|
|
||||||
|
:global PackagesUpdateDeferReboot;
|
||||||
|
|
||||||
:local Schedule do={
|
:local Schedule do={
|
||||||
:global RebootForUpdate do={
|
:global RebootForUpdate do={
|
||||||
:global RandomDelay;
|
:global RandomDelay;
|
||||||
|
@ -109,6 +111,11 @@ $ScriptLock $0;
|
||||||
$Schedule;
|
$Schedule;
|
||||||
$LogPrintExit2 info $0 ("Scheduled reboot for update between 03:00 and 04:00.") true;
|
$LogPrintExit2 info $0 ("Scheduled reboot for update between 03:00 and 04:00.") true;
|
||||||
}
|
}
|
||||||
|
} else={
|
||||||
|
:if ($PackagesUpdateDeferReboot = true) do={
|
||||||
|
$Schedule;
|
||||||
|
$LogPrintExit2 info $0 ("Scheduled reboot for update between 03:00 and 04:00.") true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$LogPrintExit2 info $0 ("Rebooting for update.") false;
|
$LogPrintExit2 info $0 ("Rebooting for update.") false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue