aboutsummaryrefslogtreecommitdiffstats
path: root/dhcp-to-dns.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-06 15:28:55 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 15:27:15 +0100
commitef5972e9f09be975f0905ca8d81477bc443515cb (patch)
tree8fbeae045ca273f9101dabe56a8e9dedf61ad1f4 /dhcp-to-dns.rsc
parent0d1c4cece27094aa529a5bf75ef5a0bae3bc6321 (diff)
dhcp-to-dns: drop main function, use :do with on-error
Diffstat (limited to 'dhcp-to-dns.rsc')
-rw-r--r--dhcp-to-dns.rsc10
1 files 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={ }