aboutsummaryrefslogtreecommitdiffstats
path: root/ipsec-to-dns.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'ipsec-to-dns.rsc')
-rw-r--r--ipsec-to-dns.rsc12
1 files changed, 6 insertions, 6 deletions
diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc
index 26dab0a..1b5ed13 100644
--- a/ipsec-to-dns.rsc
+++ b/ipsec-to-dns.rsc
@@ -9,11 +9,11 @@
# and add/remove/update DNS entries from IPSec mode-config
# https://rsc.eworm.de/doc/ipsec-to-dns.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 Domain;
@@ -79,6 +79,6 @@
/ip/dns/static/add name=$Fqdn address=($PeerVal->"dynamic-address") ttl=$Ttl comment=$Comment place-before=$PlaceBefore;
}
}
-} on-error={
- :global ExitError; $ExitError $ExitOK [ :jobname ];
+} do={
+ :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
}