netwatch-notify: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:21:27 +01:00
parent d7b0bee564
commit ab854e843b
2 changed files with 4 additions and 6 deletions

View file

@ -3,12 +3,11 @@
# Copyright (c) 2020-2026 Christian Hesse <mail@eworm.de>
# https://rsc.eworm.de/COPYING.md
#
# requires RouterOS, version=7.19
# requires RouterOS, version=7.22
#
# 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 ExitOnError; $ExitOnError [ :jobname ] $Err;
}