From 213d326ad46dd115c3e6eaf673c4d384d89ec3c3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 16 Mar 2019 23:36:38 +0100 Subject: accesslist-duplicates: Read index from terminal inkey --- accesslist-duplicates.capsman | 6 +++--- accesslist-duplicates.local | 6 +++--- accesslist-duplicates.template | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/accesslist-duplicates.capsman b/accesslist-duplicates.capsman index 633c771..a7ae099 100644 --- a/accesslist-duplicates.capsman +++ b/accesslist-duplicates.capsman @@ -21,9 +21,9 @@ / caps-man access-list print where mac-address=$Mac; :set Shown ($Shown, $Mac); - :put "\nEnter to skip, numeric id to remove!"; - :local Remove [ :return ]; - :if ($Remove != "") do={ + :put "\nNumeric id to remove, any key to skip!"; + :local Remove ([ :terminal inkey ] - 48); + :if ($Remove >= 0 && $Remove <= 9) do={ :put ("Removing numeric id " . $Remove . "...\n"); / caps-man access-list remove $Remove; } diff --git a/accesslist-duplicates.local b/accesslist-duplicates.local index cf14c3d..94b6b18 100644 --- a/accesslist-duplicates.local +++ b/accesslist-duplicates.local @@ -21,9 +21,9 @@ / interface wireless access-list print where mac-address=$Mac; :set Shown ($Shown, $Mac); - :put "\nEnter to skip, numeric id to remove!"; - :local Remove [ :return ]; - :if ($Remove != "") do={ + :put "\nNumeric id to remove, any key to skip!"; + :local Remove ([ :terminal inkey ] - 48); + :if ($Remove >= 0 && $Remove <= 9) do={ :put ("Removing numeric id " . $Remove . "...\n"); / interface wireless access-list remove $Remove; } diff --git a/accesslist-duplicates.template b/accesslist-duplicates.template index 9bb3ce1..7345ad5 100644 --- a/accesslist-duplicates.template +++ b/accesslist-duplicates.template @@ -22,9 +22,9 @@ / %PATH% access-list print where mac-address=$Mac; :set Shown ($Shown, $Mac); - :put "\nEnter to skip, numeric id to remove!"; - :local Remove [ :return ]; - :if ($Remove != "") do={ + :put "\nNumeric id to remove, any key to skip!"; + :local Remove ([ :terminal inkey ] - 48); + :if ($Remove >= 0 && $Remove <= 9) do={ :put ("Removing numeric id " . $Remove . "...\n"); / %PATH% access-list remove $Remove; } -- cgit v1.2.3-70-g09d2