aboutsummaryrefslogtreecommitdiffstats
path: root/accesslist-duplicates.local
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-11-18 18:05:33 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-11-19 20:18:39 +0100
commit15d8652c296597e42582e7248362fed70656e0df (patch)
tree47935a4df7455161e880e888e661449c384f4074 /accesslist-duplicates.local
parent868879ec8d431b6e50ed4bfc098b562a319270f5 (diff)
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.
Diffstat (limited to 'accesslist-duplicates.local')
-rw-r--r--accesslist-duplicates.local6
1 files changed, 4 insertions, 2 deletions
diff --git a/accesslist-duplicates.local b/accesslist-duplicates.local
index 4d058d4..cb2e7c3 100644
--- a/accesslist-duplicates.local
+++ b/accesslist-duplicates.local
@@ -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;
}