collect-wireless-mac: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:10:22 +01:00
parent deac154e9b
commit b2b0aa2bdc
5 changed files with 13 additions and 21 deletions

View file

@ -4,7 +4,7 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: dhcpv4-server-lease, order=40
# requires RouterOS, version=7.19
# requires RouterOS, version=7.22
#
# collect wireless mac adresses in access list
# https://rsc.eworm.de/doc/collect-wireless-mac.md
@ -12,7 +12,6 @@
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -31,8 +30,7 @@
:global SymbolForNotification;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
:set ExitOK true;
:error false;
:exit;
}
:if ([ :len [ /caps-man/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
@ -114,5 +112,5 @@
}
}
} do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
}