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:25:01 +0100
commitb60dcb5fad6181692a057a541a47cb1bc8ef2671 (patch)
tree0e5550f509eaa7a6c57ff4adeb3df011817c518b /firmware-upgrade-reboot
parent3dd34523037ce356092eee59bc35acaa8d7020ed (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. (cherry picked from commit 3f8e835233d8d9ac6f31572a1a115eb73c46ff92)
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;