aboutsummaryrefslogtreecommitdiffstats
path: root/update-gre-address.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'update-gre-address.rsc')
-rw-r--r--update-gre-address.rsc12
1 files changed, 6 insertions, 6 deletions
diff --git a/update-gre-address.rsc b/update-gre-address.rsc
index cddfa92..dd7d63e 100644
--- a/update-gre-address.rsc
+++ b/update-gre-address.rsc
@@ -9,11 +9,11 @@
# ipsec remote peer
# https://rsc.eworm.de/doc/update-gre-address.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 CharacterReplace;
@@ -41,6 +41,6 @@
}
}
}
-} on-error={
- :global ExitError; $ExitError $ExitOK [ :jobname ];
+} do={
+ :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
}