diff options
author | Christian Hesse <mail@eworm.de> | 2022-02-11 00:19:41 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-02-11 00:19:41 +0100 |
commit | 3f8e835233d8d9ac6f31572a1a115eb73c46ff92 (patch) | |
tree | ee9f78cd8bd198f5b2ad4410212adcdaf9138790 /firmware-upgrade-reboot | |
parent | 674398b3428448a7177873ca4c875c2695f88da8 (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-reboot | 5 |
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; |