accesslist-duplicates: support interactive removal

This commit is contained in:
Christian Hesse 2018-11-09 21:23:12 +01:00
parent ecf75697ba
commit 0b121705b2
3 changed files with 27 additions and 0 deletions

View file

@ -9,6 +9,8 @@
:local seen [ :toarray "" ]; :local seen [ :toarray "" ];
:local shown [ :toarray "" ]; :local shown [ :toarray "" ];
:global Read;
:foreach acclist in=[ / caps-man access-list find where mac-address!="00:00:00:00:00:00" ] do={ :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 ]; :local mac [ / caps-man access-list get $acclist mac-address ];
:foreach "seen-mac" in=$seen do={ :foreach "seen-mac" in=$seen do={
@ -20,6 +22,13 @@
:if ($skip = 0) do={ :if ($skip = 0) do={
/ caps-man access-list print where mac-address=$mac; / caps-man access-list print where mac-address=$mac;
:set $shown ( $shown , $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;
}
} }
} }
} }

View file

@ -9,6 +9,8 @@
:local seen [ :toarray "" ]; :local seen [ :toarray "" ];
:local shown [ :toarray "" ]; :local shown [ :toarray "" ];
:global Read;
:foreach acclist in=[ / interface wireless access-list find where mac-address!="00:00:00:00:00:00" ] do={ :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 ]; :local mac [ / interface wireless access-list get $acclist mac-address ];
:foreach "seen-mac" in=$seen do={ :foreach "seen-mac" in=$seen do={
@ -20,6 +22,13 @@
:if ($skip = 0) do={ :if ($skip = 0) do={
/ interface wireless access-list print where mac-address=$mac; / interface wireless access-list print where mac-address=$mac;
:set $shown ( $shown , $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");
/ interface wireless access-list remove $remove;
}
} }
} }
} }

View file

@ -10,6 +10,8 @@
:local seen [ :toarray "" ]; :local seen [ :toarray "" ];
:local shown [ :toarray "" ]; :local shown [ :toarray "" ];
:global Read;
:foreach acclist in=[ / %PATH% access-list find where mac-address!="00:00:00:00:00:00" ] do={ :foreach acclist in=[ / %PATH% access-list find where mac-address!="00:00:00:00:00:00" ] do={
:local mac [ / %PATH% access-list get $acclist mac-address ]; :local mac [ / %PATH% access-list get $acclist mac-address ];
:foreach "seen-mac" in=$seen do={ :foreach "seen-mac" in=$seen do={
@ -21,6 +23,13 @@
:if ($skip = 0) do={ :if ($skip = 0) do={
/ %PATH% access-list print where mac-address=$mac; / %PATH% access-list print where mac-address=$mac;
:set $shown ( $shown , $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");
/ %PATH% access-list remove $remove;
}
} }
} }
} }