netwatch-notify: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:21:27 +01:00
parent bb40c7a33d
commit e2fdb76f43

View file

@ -8,7 +8,6 @@
# monitor netwatch and send notifications
# https://rsc.eworm.de/doc/netwatch-notify.md
:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -80,8 +79,7 @@
}
:if ([ $ScriptLock $ScriptName ] = false) do={
:set ExitOK true;
:error false;
:exit;
}
:local ScriptFromTerminalCached [ $ScriptFromTerminal $ScriptName ];
@ -225,5 +223,5 @@
}
}
} do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
:global ExitError; $ExitError false [ :jobname ] $Err;
}