1

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

You need Zenity:

sudo apt-get install zenity 

Then to get a password do:

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

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.