mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-21 16:39:32 +00:00
netwatch-notify: early exit with :exit
This commit is contained in:
parent
bb40c7a33d
commit
e2fdb76f43
1 changed files with 2 additions and 4 deletions
|
|
@ -8,7 +8,6 @@
|
||||||
# monitor netwatch and send notifications
|
# monitor netwatch and send notifications
|
||||||
# https://rsc.eworm.de/doc/netwatch-notify.md
|
# https://rsc.eworm.de/doc/netwatch-notify.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) \
|
||||||
|
|
@ -80,8 +79,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:local ScriptFromTerminalCached [ $ScriptFromTerminal $ScriptName ];
|
:local ScriptFromTerminalCached [ $ScriptFromTerminal $ScriptName ];
|
||||||
|
|
@ -225,5 +223,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} do={
|
} do={
|
||||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue