From ef5972e9f09be975f0905ca8d81477bc443515cb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 6 Mar 2024 15:28:55 +0100 Subject: dhcp-to-dns: drop main function, use :do with on-error --- dhcp-to-dns.rsc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index df6ae01..84a1e84 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -12,8 +12,8 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } -:local Main do={ - :local ScriptName [ :tostr $1 ]; +:do { + :local ScriptName [ :jobname ]; :global Domain; :global Identity; @@ -27,7 +27,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ - :return false; + :error false; } :local Ttl 5m; @@ -123,6 +123,4 @@ $LogPrintExit2 debug $ScriptName ("No address available... Ignoring.") false; } } -} - -$Main [ :jobname ]; +} on-error={ } -- cgit v1.2.3-70-g09d2