update-gre-address: drop main function, use :do with on-error

This commit is contained in:
Christian Hesse 2024-03-06 15:28:55 +01:00
parent 738dd11929
commit febd13af13

View file

@ -12,15 +12,15 @@
:global GlobalFunctionsReady; :global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } :while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
:local Main do={ :do {
:local ScriptName [ :tostr $1 ]; :local ScriptName [ :jobname ];
:global CharacterReplace; :global CharacterReplace;
:global LogPrintExit2; :global LogPrintExit2;
:global ScriptLock; :global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={ :if ([ $ScriptLock $ScriptName ] = false) do={
:return false; :error false;
} }
/interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ]; /interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
@ -39,6 +39,4 @@
} }
} }
} }
} } on-error={ }
$Main [ :jobname ];