aboutsummaryrefslogtreecommitdiffstats
path: root/accesslist-duplicates.template.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'accesslist-duplicates.template.rsc')
-rw-r--r--accesslist-duplicates.template.rsc27
1 files changed, 15 insertions, 12 deletions
diff --git a/accesslist-duplicates.template.rsc b/accesslist-duplicates.template.rsc
index d275340..bf23147 100644
--- a/accesslist-duplicates.template.rsc
+++ b/accesslist-duplicates.template.rsc
@@ -1,20 +1,21 @@
#!rsc by RouterOS
# RouterOS script: accesslist-duplicates%TEMPL%
-# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
-# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
+# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
+# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.14
+# requires RouterOS, version=7.15
#
# print duplicate antries in wireless access list
-# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md
+# https://rsc.eworm.de/doc/accesslist-duplicates.md
#
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:global GlobalFunctionsReady;
-:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
-
-:do {
+:local ExitOK false;
+:onerror Err {
+ :global GlobalConfigReady; :global GlobalFunctionsReady;
+ :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
+ do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50;
:local ScriptName [ :jobname ];
:local Seen ({});
@@ -26,9 +27,9 @@
:local Mac [ /interface/wifi/access-list/get $AccList mac-address ];
:local Mac [ /interface/wireless/access-list/get $AccList mac-address ];
:if ($Seen->$Mac = 1) do={
- /caps-man/access-list/print where mac-address=$Mac;
- /interface/wifi/access-list/print where mac-address=$Mac;
- /interface/wireless/access-list/print where mac-address=$Mac;
+ /caps-man/access-list/print without-paging where mac-address=$Mac;
+ /interface/wifi/access-list/print without-paging where mac-address=$Mac;
+ /interface/wireless/access-list/print without-paging where mac-address=$Mac;
:local Remove [ :tonum [ /terminal/ask prompt="\nNumeric id to remove, any key to skip!" ] ];
:if ([ :typeof $Remove ] = "num") do={
@@ -40,4 +41,6 @@
}
:set ($Seen->$Mac) 1;
}
-} on-error={ }
+} do={
+ :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+}