ppp-on-up: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:24:01 +01:00
parent 34ca3fd2ef
commit 19a8ae84ed

View file

@ -8,7 +8,6 @@
# run scripts on ppp up # run scripts on ppp up
# https://rsc.eworm.de/doc/ppp-on-up.md # https://rsc.eworm.de/doc/ppp-on-up.md
:local ExitOK false;
:onerror Err { :onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady; :global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -21,8 +20,7 @@
:if ([ :typeof $Interface ] = "nothing") do={ :if ([ :typeof $Interface ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from ppp on-up script hook."); $LogPrint error $ScriptName ("This script is supposed to run from ppp on-up script hook.");
:set ExitOK true; :exit;
:error false;
} }
:local IntName [ /interface/get $Interface name ]; :local IntName [ /interface/get $Interface name ];
@ -40,5 +38,5 @@
} }
} }
} do={ } do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err; :global ExitError; $ExitError false [ :jobname ] $Err;
} }