mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
36 lines
1 KiB
Text
36 lines
1 KiB
Text
#!rsc
|
|
# RouterOS script: accesslist-duplicates.capsman
|
|
# Copyright (c) 2018 Christian Hesse <mail@eworm.de>
|
|
#
|
|
# print duplicate antries in wireless access list
|
|
#
|
|
# !! Do not edit this file, it is generated from template!
|
|
|
|
:local seen [ :toarray "" ];
|
|
:local shown [ :toarray "" ];
|
|
|
|
:global Read;
|
|
|
|
:foreach acclist in=[ / caps-man access-list find where mac-address!="00:00:00:00:00:00" ] do={
|
|
:local mac [ / caps-man access-list get $acclist mac-address ];
|
|
:foreach "seen-mac" in=$seen do={
|
|
:if ($"seen-mac" = $mac) do={
|
|
:local skip 0;
|
|
:foreach "shown-mac" in=$shown do={
|
|
:if ($"shown-mac" = $mac) do={ :set skip 1; }
|
|
}
|
|
:if ($skip = 0) do={
|
|
/ caps-man access-list print where mac-address=$mac;
|
|
:set shown ( $shown , $mac );
|
|
|
|
:put "\nEnter to skip, numeric id to remove!";
|
|
:local remove [ $Read ];
|
|
:if ($remove != "") do={
|
|
:put ("Removing numeric id " . $remove . "...\n");
|
|
/ caps-man access-list remove $remove;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
:set seen ( $seen , $mac );
|
|
}
|