diff options
author | Christian Hesse <mail@eworm.de> | 2024-03-06 15:28:55 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-03-12 15:27:15 +0100 |
commit | 341e84682cd3242735a0776640901ed0b9b7bebe (patch) | |
tree | c047e6c7dbceeb227b53ba66dce612b9b81c3695 | |
parent | 54638924e4a06f926d3bdd3bbd44489acc692a75 (diff) |
ipsec-to-dns: drop main function, use :do with on-error
-rw-r--r-- | ipsec-to-dns.rsc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc index e19a11b..03abf59 100644 --- a/ipsec-to-dns.rsc +++ b/ipsec-to-dns.rsc @@ -11,8 +11,8 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } -:local Main do={ - :local ScriptName [ :tostr $1 ]; +:do { + :local ScriptName [ :jobname ]; :global Domain; :global HostNameInZone; @@ -26,7 +26,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ - :return false; + :error false; } :local Zone \ @@ -76,6 +76,4 @@ /ip/dns/static/add name=$Fqdn address=($PeerVal->"dynamic-address") ttl=$Ttl comment=$Comment place-before=$PlaceBefore; } } -} - -$Main [ :jobname ]; +} on-error={ } |