I want to make a script with an if that only runs if the user Input the Right password.

Like this:

Some Code..
if(Input == "password"){
    Do something
More Code..

Everything runs on a x Server with matchbox-window-Manager, so not on a console.

Whats a the best way to open a Input Dialog?

If the Input gets checked to equal a user Password its fine too, i just need a very simple password check dialog.

1 Answer 1


You need Zenity:

sudo apt-get install zenity 

Then to get a password do:

echo "Some Code..."
read Input < <(zenity --password --title="Enter your password")
if [[ "$Input" = "password" ]]; then
    echo "Do something"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .