ospf-to-leds: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:22:02 +01:00
parent e2fdb76f43
commit b8839ed6df

View file

@ -8,7 +8,6 @@
# visualize ospf instance state via leds # visualize ospf instance state via leds
# https://rsc.eworm.de/doc/ospf-to-leds.md # https://rsc.eworm.de/doc/ospf-to-leds.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) \
@ -20,8 +19,7 @@
:global ScriptLock; :global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={ :if ([ $ScriptLock $ScriptName ] = false) do={
:set ExitOK true; :exit;
:error false;
} }
:foreach Instance in=[ /routing/ospf/instance/find where comment~"^ospf-to-leds," ] do={ :foreach Instance in=[ /routing/ospf/instance/find where comment~"^ospf-to-leds," ] do={
@ -45,5 +43,5 @@
} }
} }
} do={ } do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err; :global ExitError; $ExitError false [ :jobname ] $Err;
} }