aboutsummaryrefslogtreecommitdiffstats
path: root/firmware-upgrade-reboot.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'firmware-upgrade-reboot.rsc')
-rw-r--r--firmware-upgrade-reboot.rsc12
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware-upgrade-reboot.rsc b/firmware-upgrade-reboot.rsc
index 86a9a8c..e3ca55b 100644
--- a/firmware-upgrade-reboot.rsc
+++ b/firmware-upgrade-reboot.rsc
@@ -8,11 +8,11 @@
# install firmware upgrade, and reboot
# https://rsc.eworm.de/doc/firmware-upgrade-reboot.md
-:global GlobalFunctionsReady;
-:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
-
:local ExitOK false;
-:do {
+:onerror Err {
+ :global GlobalConfigReady; :global GlobalFunctionsReady;
+ :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
+ do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50;
:local ScriptName [ :jobname ];
:global LogPrint;
@@ -55,6 +55,6 @@
$LogPrint info $ScriptName ("Firmware upgrade successful, rebooting.");
/system/reboot;
-} on-error={
- :global ExitError; $ExitError $ExitOK [ :jobname ];
+} do={
+ :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
}