From 15d8652c296597e42582e7248362fed70656e0df Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 18 Nov 2021 18:05:33 +0100 Subject: 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. --- accesslist-duplicates.capsman | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'accesslist-duplicates.capsman') diff --git a/accesslist-duplicates.capsman b/accesslist-duplicates.capsman index 5fcf6ae..3992991 100644 --- a/accesslist-duplicates.capsman +++ b/accesslist-duplicates.capsman @@ -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; } -- cgit v1.2.3-54-g00ecf