From febd13af13c3bd0fff3d702364a3979d3e4221a3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 6 Mar 2024 15:28:55 +0100 Subject: update-gre-address: drop main function, use :do with on-error --- update-gre-address.rsc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/update-gre-address.rsc b/update-gre-address.rsc index d9a7a55..78705c5 100644 --- a/update-gre-address.rsc +++ b/update-gre-address.rsc @@ -12,15 +12,15 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } -:local Main do={ - :local ScriptName [ :tostr $1 ]; +:do { + :local ScriptName [ :jobname ]; :global CharacterReplace; :global LogPrintExit2; :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ - :return false; + :error false; } /interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ]; @@ -39,6 +39,4 @@ } } } -} - -$Main [ :jobname ]; +} on-error={ } -- cgit v1.2.3-54-g00ecf