Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- s_username="${BASH_ARGV[1]}"
- s_command="${BASH_ARGV[0]}"
- if [[ -z "$s_command" ]]; then
- exit
- fi
- if [[ -z "$s_username" ]]; then
- s_username="root"
- fi
- s_password=$(
- zenity --entry --hide-text --modal \
- --title="Uruchom jako $s_username" \
- --text="Uruchamianie polecenia:\n\t$s_command\njako użytkownik:\n\t$s_username\n\nProszę podać hasło." \
- --ok-label="Uruchom" --cancel-label="Anuluj" 2> /dev/null
- )
- if [[ -n "$s_password" ]]; then
- sudo -K
- sudo -H -S -p "" mousepad <<< "$s_password"
- if [[ $? -gt 0 ]]; then
- zenity --error --text="Podane hasło jest niepoprawne." 2> /dev/null
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement