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.
This commit is contained in:
Christian Hesse 2022-02-11 00:19:41 +01:00
parent 674398b342
commit 3f8e835233

View file

@ -28,5 +28,10 @@
:delay 1s; :delay 1s;
} }
:local Uptime [ / system resource get uptime ];
:if ($Uptime < 1m) do={
:delay $Uptime;
}
$LogPrintExit2 info $0 ("Firmware upgrade successful, rebooting.") false; $LogPrintExit2 info $0 ("Firmware upgrade successful, rebooting.") false;
/ system reboot; / system reboot;