Questions tagged [whiptail]

Whiptail is a tool used for displaying dialog boxes to users.

Whiptail is commonly used to display data in the form of data boxes. Some of the most common dialog boxes include

Info Box: (A data box displaying text)

whiptail --infobox "This is an infobox"

Message Box: (Waits for the user to click the OK button)

whiptail --msgbox "This is a message box"

Yes/No Box: (Offers users a choice of yes or no)

whiptail --yesno "Do you like dogs?"

Input Box: (Allows for user input)

whiptail --inputbox "Tell us your thoughts"

Password Box: (Masks user input)

whiptail --passwordbox "Enter a password"

Menu: (Present users with a list of options)

whiptail --menu "Choose an option [Dialog Height] [Dialog Width] [Menu Height] \ Apple A red fruit \ Pineaaple A tropical fruit \ Watermelon A Summer Fruit"

For more information please visit

https://en.wikibooks.org/wiki/Bash_Shell_Scripting/Whiptail

68 questions
0
votes
1 answer

Shell script function with global variable

yesterday I got a very easy task, but unfortunatelly looks like i can't do with a nice code. The task briefly: I have a lot of parameters, that I want to ask with whiptail "interactive" mode in the installer script. The detail of code:…
0
votes
0 answers

sudo with -S still asks for password on the console and clears out whiptail box

I'm doing some homework for my operative systems class where we have to make a login flow using only bash scripting, I'm having problems as I want to do it with a GUI so I started using whiptail but when I check for the validity of the password…
HardCodeStuds
  • 407
  • 2
  • 11
  • 29
0
votes
0 answers

Bash Whiptail Gauge Progress

i want to use whiptail --gauge to show the current process of a User Deletion. In this Process i will first lock them out, backing up his home, killing his Processes etc. How could i use whiptail --gauge that it will only be shown once and updated…
Serverfrog
  • 179
  • 2
  • 17
0
votes
1 answer

Bash - Compare User input with array

I want to validate did user input proper device in whiptail dialog or did user input something wrong. I'm googling this for 2 days and can'f find any similar question/issue. This is my code: ALL_DEVICES=$(ifconfig -a | grep Ethernet | awk '{print…
0
votes
1 answer

Bash whiptail dies when changing directory

I'm trying to change to a directory and run additional commands within my whiptail dialog screen, but after cloning my git repository it seems that my script is now dying when trying to change to the directory: STATUS=0 touch log.txt while [ $STATUS…
Godzilla74
  • 2,358
  • 1
  • 31
  • 67
0
votes
1 answer

whiptail/dialog dynamic arguments

I want to construct a dynamic user friendly menu. I got stuck and found this answer So, the question is pretty simple: why isn't it working? COUNT=1 AUX=0; for proj in $PROJECTPATH/*; do if ! [ -d $proj ]; then echo "$proj is not a…
0
votes
1 answer

redirect input string from dialog's --inputbox to stderr

Dialog's --inputbox option does the following: On exit, the input string will be printed on dialog's output. But how can I separate the input string from all those ANSI color codes that get printed to stdout? Or can I tell dialog somehow to write…
philx_x
  • 1,708
  • 16
  • 23
0
votes
2 answers

If statement goes else every time - bash

I am very new here, so I apologize for any my mistakes, and I am sorry for my lack of knowledge (I'm just beginner). So here it is, i am doing little script in bash with li and I have if statement, here it is #!/bin/bash something=$(whiptail…
0
votes
1 answer

How to set default text for bash whiptail input boxes?

I am making a simple installer that uses whiptail prompts for user input. I'd like to be able to set the default text. Unfortunately --default-item doesn't work and appears to only be for menu items. MYLARUSER=$(whiptail --inputbox "Enter the user…
Mike Andreasen
  • 379
  • 2
  • 11
0
votes
1 answer

Can you sudo with input whiptail?

I want to ask your sudo password with whiptail password and then use it to run sudo script.sh this is possible? I have tried this sudo command with the whiptail input for password sudo -S <<< $psw script.sh echo $ psw | sudo -S Full…
Miguel Zablah
  • 45
  • 1
  • 9
0
votes
1 answer

Bash Whiptail ping progress bar

I am trying to make a progress bar using Whiptail that can track the progress of the wget ping correctly. My goal is to create a script that test your internet by making a ping to google.com and while this is happening that is shows you the progress…
Miguel Zablah
  • 45
  • 1
  • 9
0
votes
1 answer

dialog displaying dialog boxes image configuration

I am trying to use dialog on my Linux box. The output does not seem proper. If you look at not the whole box outline is in black. Can you please what are some commonly used color settings. I cannot use whiptail.
gudge
  • 1,053
  • 4
  • 18
  • 33
0
votes
1 answer

whiptail info box use

Could you please tell me what is the use of Whiptail info box. Whiptail Info Box The message just comes and goes. Is there a way to display the message for a specific time.
gudge
  • 1,053
  • 4
  • 18
  • 33
0
votes
1 answer

Using whiptail with Python subprocess

I am executing the following whitetail command mentioned here WhipTail Example whiptail --title "Check list example" --checklist \ "Choose user's permissions" 20 78 4 \ "NET_OUTBOUND" "Allow connections to other hosts" ON \ "NET_INBOUND" "Allow…
gudge
  • 1,053
  • 4
  • 18
  • 33
0
votes
1 answer

Taking awk Output with Spaces and Putting it in a Whiptail Menu with BASH

I've got a BASH script that I'm wanting to have grab all SSIDs of nearby wireless networks and output them to a menu that users can choose from. I've got the portion to list out the networks, they get shown in a menu and the resulting SSID gets…
Death259
  • 153
  • 2
  • 14