From 3f8e835233d8d9ac6f31572a1a115eb73c46ff92 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 11 Feb 2022 00:19:41 +0100 Subject: [PATCH] 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. --- firmware-upgrade-reboot | 5 +++++ 1 file changed, 5 insertions(+) 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;