1

I am trying to build a iptables configure with whiptail. And I am stuck at the moment. I have got code below and I am trying to develop radio list where user choose between INPUT or OUPUT.

io=$(whiptail --title "Add rule" --radiolist "Choose" 20 40 15 \
"INPUT" "" ON \
"OUTPUT" "" OFF \
3>&1 1>&2 2>&3)

echo "$io"

exit

After this script is shown in whiptail screen I choose for ex. second option (OUTPUT) but I got result "INPUT". Also I am not able to shift an asterisk. I don't know If asterisk should be shifting or don't.

Choosen OUTPUT but in command line is INPUT

I appreaciate your help and have a nice day guys!

EDIT: SOLVED, USE SPACE BAR

1

You can toggle the state of a radiolist item using the spacebar. The state is shown with the asterisk (*). Simply moving the cursor up/down with cursor-keys has no effect on the selection.

Interestingly, the manual pages for whiptail and dialog do not mention the detail of the space-bar for radio-lists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.