mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
packages-update: check version before reboot from scheduler
Chances are that the device was rebooted manually... Do not reboot then.
This commit is contained in:
parent
95b8a47b81
commit
7c2ac135e3
1 changed files with 3 additions and 2 deletions
|
@ -82,8 +82,9 @@ $ScriptLock $0;
|
|||
:put "Do you want to (s)chedule reboot or (r)eboot now? [s/R]";
|
||||
:if (([ /terminal/inkey timeout=60 ] % 32) = 19) do={
|
||||
/system/scheduler/add name="reboot-for-update" start-time=03:00:00 interval=1d \
|
||||
on-event=(":global RandomDelay; \$RandomDelay 3600; " . \
|
||||
"/system/scheduler/remove reboot-for-update; /system/reboot;");
|
||||
on-event=("/system/scheduler/remove reboot-for-update; " . \
|
||||
":if ([ /system/package/update/get installed-version ] != \"" . $Update->"latest-version" . "\") " . \
|
||||
"do={ :global RandomDelay; \$RandomDelay 3600; /system/reboot; }");
|
||||
$LogPrintExit2 info $0 ("Scheduled reboot for update between 03:00 and 04:00.") true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue