From f0856c264e07804a229668268a457f2154cb373a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 6 Mar 2024 15:28:55 +0100 Subject: update-tunnelbroker: drop main function, use :do with on-error --- update-tunnelbroker.rsc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc index 90e3f24..9f316e3 100644 --- a/update-tunnelbroker.rsc +++ b/update-tunnelbroker.rsc @@ -13,8 +13,8 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } -:local Main do={ - :local ScriptName [ :tostr $1 ]; +:do { + :local ScriptName [ :jobname ]; :global CertificateAvailable; :global LogPrintExit2; @@ -22,7 +22,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ - :return false; + :error false; } :if ([ $CertificateAvailable "Starfield Secure Certificate Authority - G2" ] = false) do={ @@ -62,6 +62,4 @@ /interface/6to4/set $Interface local-address=$PublicAddress; } } -} - -$Main [ :jobname ]; +} on-error={ } -- cgit v1.2.3-54-g00ecf