collect-wireless-mac: early exit with :exit

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

View file

@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md # https://rsc.eworm.de/COPYING.md
# #
# provides: lease-script, order=40 # provides: lease-script, order=40
# requires RouterOS, version=7.19 # requires RouterOS, version=7.22
# #
# collect wireless mac adresses in access list # collect wireless mac adresses in access list
# https://rsc.eworm.de/doc/collect-wireless-mac.md # https://rsc.eworm.de/doc/collect-wireless-mac.md
# #
# !! Do not edit this file, it is generated from template! # !! Do not edit this file, it is generated from template!
: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) \
@ -30,8 +29,7 @@
:global SymbolForNotification; :global SymbolForNotification;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={ :if ([ $ScriptLock $ScriptName 10 ] = false) do={
:set ExitOK true; :exit;
:error false;
} }
:if ([ :len [ /caps-man/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={ :if ([ :len [ /caps-man/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
@ -96,5 +94,5 @@
} }
} }
} do={ } do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err; :global ExitOnError; $ExitOnError [ :jobname ] $Err;
} }

View file

@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md # https://rsc.eworm.de/COPYING.md
# #
# provides: lease-script, order=40 # provides: lease-script, order=40
# requires RouterOS, version=7.19 # requires RouterOS, version=7.22
# #
# collect wireless mac adresses in access list # collect wireless mac adresses in access list
# https://rsc.eworm.de/doc/collect-wireless-mac.md # https://rsc.eworm.de/doc/collect-wireless-mac.md
# #
# !! Do not edit this file, it is generated from template! # !! Do not edit this file, it is generated from template!
: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) \
@ -30,8 +29,7 @@
:global SymbolForNotification; :global SymbolForNotification;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={ :if ([ $ScriptLock $ScriptName 10 ] = false) do={
:set ExitOK true; :exit;
:error false;
} }
:if ([ :len [ /interface/wireless/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={ :if ([ :len [ /interface/wireless/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
@ -97,5 +95,5 @@
} }
} }
} do={ } do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err; :global ExitOnError; $ExitOnError [ :jobname ] $Err;
} }

View file

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

View file

@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md # https://rsc.eworm.de/COPYING.md
# #
# provides: lease-script, order=40 # provides: lease-script, order=40
# requires RouterOS, version=7.19 # requires RouterOS, version=7.22
# #
# collect wireless mac adresses in access list # collect wireless mac adresses in access list
# https://rsc.eworm.de/doc/collect-wireless-mac.md # https://rsc.eworm.de/doc/collect-wireless-mac.md
# #
# !! Do not edit this file, it is generated from template! # !! Do not edit this file, it is generated from template!
: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) \
@ -30,8 +29,7 @@
:global SymbolForNotification; :global SymbolForNotification;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={ :if ([ $ScriptLock $ScriptName 10 ] = false) do={
:set ExitOK true; :exit;
:error false;
} }
:if ([ :len [ /interface/wifi/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={ :if ([ :len [ /interface/wifi/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
@ -96,5 +94,5 @@
} }
} }
} do={ } do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err; :global ExitOnError; $ExitOnError [ :jobname ] $Err;
} }

View file

@ -4,7 +4,7 @@ Collect MAC addresses in wireless access list
[![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network)
[![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers)
[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.19-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![required RouterOS version](https://img.shields.io/badge/RouterOS-7.22-yellow?style=flat)](https://mikrotik.com/download/changelogs/)
[![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts)
[![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)