aboutsummaryrefslogtreecommitdiffstats
path: root/firmware-upgrade-reboot
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-02-11 00:19:41 +0100
committerGravatar Christian Hesse <mail@eworm.de>2022-02-11 00:19:41 +0100
commit3f8e835233d8d9ac6f31572a1a115eb73c46ff92 (patch)
treeee9f78cd8bd198f5b2ad4410212adcdaf9138790 /firmware-upgrade-reboot
parent674398b3428448a7177873ca4c875c2695f88da8 (diff)
firmware-upgrade-reboot: add a delay before reboot
Looks like my timing was too good... Upgrade and reboot happened too fast, so device reported: system;error;critical router was rebooted without proper shutdown Let's try something smart... Delay the reboot by the amount of uptime, and hope all devices - slow and powerful - are happy.
Diffstat (limited to 'firmware-upgrade-reboot')
-rw-r--r--firmware-upgrade-reboot5
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware-upgrade-reboot b/firmware-upgrade-reboot
index b3cb621..a3a25db 100644
--- a/firmware-upgrade-reboot
+++ b/firmware-upgrade-reboot
@@ -28,5 +28,10 @@
:delay 1s;
}
+:local Uptime [ / system resource get uptime ];
+:if ($Uptime < 1m) do={
+ :delay $Uptime;
+}
+
$LogPrintExit2 info $0 ("Firmware upgrade successful, rebooting.") false;
/ system reboot;