diff options
author | Christian Hesse <mail@eworm.de> | 2023-10-16 21:40:56 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-10-17 14:05:03 +0200 |
commit | 8bfbc9dd7edb6792da9397b0b056d40060da9bbc (patch) | |
tree | 58c69153f1d922e382faf1f4e51f425596f6923f /accesslist-duplicates.template.rsc | |
parent | 0e83d2e317288442de06e6aea16aaaf0f7654f08 (diff) |
accesslist-duplicates: use named array
Diffstat (limited to 'accesslist-duplicates.template.rsc')
-rw-r--r-- | accesslist-duplicates.template.rsc | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/accesslist-duplicates.template.rsc b/accesslist-duplicates.template.rsc index 85d444e..0bacd0d 100644 --- a/accesslist-duplicates.template.rsc +++ b/accesslist-duplicates.template.rsc @@ -25,26 +25,20 @@ :local Mac [ /interface/wifiwave2/access-list/get $AccList mac-address ]; :local Mac [ /interface/wireless/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={ - /caps-man/access-list/print where mac-address=$Mac; - /interface/wifiwave2/access-list/print where mac-address=$Mac; - /interface/wireless/access-list/print where mac-address=$Mac; - :set Shown ($Shown, $Mac); + :if ($SeenMac = $Mac && $Shown->$Mac != 1) do={ + /caps-man/access-list/print where mac-address=$Mac; + /interface/wifiwave2/access-list/print where mac-address=$Mac; + /interface/wireless/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"); - /caps-man/access-list/remove $Remove; - /interface/wifiwave2/access-list/remove $Remove; - /interface/wireless/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"); + /caps-man/access-list/remove $Remove; + /interface/wifiwave2/access-list/remove $Remove; + /interface/wireless/access-list/remove $Remove; } + :set ($Shown->$Mac) 1; } } :set Seen ($Seen, $Mac); |