mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
accesslist-duplicates: read more than a single digit
With RouterOS 6.x a print always starts with numeric id zero, then counts up. This is no longer true with RouterOS 7.x... Thus we have to handle two or more digits in input.
This commit is contained in:
@ -12,6 +12,8 @@
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Read do={ :return; }
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
:local Shown [ :toarray "" ];
|
||||
|
||||
@ -28,8 +30,8 @@
|
||||
:set Shown ($Shown, $Mac);
|
||||
|
||||
:put "\nNumeric id to remove, any key to skip!";
|
||||
:local Remove ([ :terminal inkey ] - 48);
|
||||
:if ($Remove >= 0 && $Remove <= 9) do={
|
||||
:local Remove [ :tonum [ $Read ] ];
|
||||
:if ([ :typeof $Remove ] = "num") do={
|
||||
:put ("Removing numeric id " . $Remove . "...\n");
|
||||
/ caps-man access-list remove $Remove;
|
||||
}
|
||||
|
@ -12,6 +12,8 @@
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Read do={ :return; }
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
:local Shown [ :toarray "" ];
|
||||
|
||||
@ -28,8 +30,8 @@
|
||||
:set Shown ($Shown, $Mac);
|
||||
|
||||
:put "\nNumeric id to remove, any key to skip!";
|
||||
:local Remove ([ :terminal inkey ] - 48);
|
||||
:if ($Remove >= 0 && $Remove <= 9) do={
|
||||
:local Remove [ :tonum [ $Read ] ];
|
||||
:if ([ :typeof $Remove ] = "num") do={
|
||||
:put ("Removing numeric id " . $Remove . "...\n");
|
||||
/ interface wireless access-list remove $Remove;
|
||||
}
|
||||
|
@ -13,6 +13,8 @@
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Read do={ :return; }
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
:local Shown [ :toarray "" ];
|
||||
|
||||
@ -29,8 +31,8 @@
|
||||
:set Shown ($Shown, $Mac);
|
||||
|
||||
:put "\nNumeric id to remove, any key to skip!";
|
||||
:local Remove ([ :terminal inkey ] - 48);
|
||||
:if ($Remove >= 0 && $Remove <= 9) do={
|
||||
:local Remove [ :tonum [ $Read ] ];
|
||||
:if ([ :typeof $Remove ] = "num") do={
|
||||
:put ("Removing numeric id " . $Remove . "...\n");
|
||||
/ %PATH% access-list remove $Remove;
|
||||
}
|
||||
|
Reference in New Issue
Block a user