routeros-scripts/accesslist-duplicates.local

37 lines
1.1 KiB
Text
Raw Normal View History

#!rsc
2018-09-03 14:19:23 +00:00
# RouterOS script: accesslist-duplicates.local
# 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;
2018-09-03 14:19:23 +00:00
:foreach acclist in=[ / interface wireless access-list find where mac-address!="00:00:00:00:00:00" ] do={
:local mac [ / interface wireless 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={
/ interface wireless access-list print where mac-address=$mac;
2018-12-12 20:57:17 +00:00
:set shown ( $shown , $mac );
:put "\nEnter to skip, numeric id to remove!";
:local remove [ $Read ];
:if ($remove != "") do={
:put ("Removing numeric id " . $remove . "...\n");
/ interface wireless access-list remove $remove;
}
2018-09-03 14:19:23 +00:00
}
}
}
2018-12-12 20:57:17 +00:00
:set seen ( $seen , $mac );
2018-09-03 14:19:23 +00:00
}