mirror of
				https://github.com/eworm-de/routeros-scripts.git
				synced 2024-05-11 05:55:19 +00:00 
			
		
		
		
	accesslist-duplicates: use named array
This commit is contained in:
		@@ -20,22 +20,16 @@
 | 
			
		||||
:foreach AccList in=[ /interface/wifiwave2/access-list/find where mac-address!="00:00:00:00:00:00" ] do={
 | 
			
		||||
  :local Mac [ /interface/wifiwave2/access-list/get $AccList mac-address ];
 | 
			
		||||
  :foreach SeenMac in=$Seen do={
 | 
			
		||||
    :if ($SeenMac = $Mac) do={
 | 
			
		||||
      :local Skip 0;
 | 
			
		||||
      :foreach ShownMac in=$Shown do={
 | 
			
		||||
        :if ($ShownMac = $Mac) do={ :set Skip 1; }
 | 
			
		||||
      }
 | 
			
		||||
      :if ($Skip = 0) do={
 | 
			
		||||
        /interface/wifiwave2/access-list/print where mac-address=$Mac;
 | 
			
		||||
        :set Shown ($Shown, $Mac);
 | 
			
		||||
    :if ($SeenMac = $Mac && $Shown->$Mac != 1) do={
 | 
			
		||||
      /interface/wifiwave2/access-list/print where mac-address=$Mac;
 | 
			
		||||
 | 
			
		||||
        :put "\nNumeric id to remove, any key to skip!";
 | 
			
		||||
        :local Remove [ :tonum [ $Read ] ];
 | 
			
		||||
        :if ([ :typeof $Remove ] = "num") do={
 | 
			
		||||
          :put ("Removing numeric id " . $Remove . "...\n");
 | 
			
		||||
          /interface/wifiwave2/access-list/remove $Remove;
 | 
			
		||||
        }
 | 
			
		||||
      :put "\nNumeric id to remove, any key to skip!";
 | 
			
		||||
      :local Remove [ :tonum [ $Read ] ];
 | 
			
		||||
      :if ([ :typeof $Remove ] = "num") do={
 | 
			
		||||
        :put ("Removing numeric id " . $Remove . "...\n");
 | 
			
		||||
        /interface/wifiwave2/access-list/remove $Remove;
 | 
			
		||||
      }
 | 
			
		||||
      :set ($Shown->$Mac) 1;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  :set Seen ($Seen, $Mac);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user