aboutsummaryrefslogtreecommitdiffstats
path: root/packages-update
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-02-16 11:06:25 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-02-16 11:53:05 +0100
commit7c2ac135e308941311b4e7defaa503ec8db108c3 (patch)
treecd3ef0394041a803d7d0a380478a1b753b35df8c /packages-update
parent95b8a47b81b987b7004dd46bf3d07a6baf948469 (diff)
packages-update: check version before reboot from scheduler
Chances are that the device was rebooted manually... Do not reboot then.
Diffstat (limited to 'packages-update')
-rw-r--r--packages-update5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages-update b/packages-update
index 9fa3b54..1c1fda8 100644
--- a/packages-update
+++ b/packages-update
@@ -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;
}
}