123456789 |
- #!/bin/bash
- MESS=$(echo -e "'$1' is attempting to perform an \n action that requires 'root' privileges. \n Authentication is required to perform this action.\n\n Please Enter Your Password:"; echo)
- TITL=$(echo -e "Authentication is needed to run $1"; echo)
- ERR=$(echo -e "Opps! Something went wrong!, \n please try again later"; echo)
- VAR=$(zenity --entry --title="$TITL" --text="$MESS" --entry-text "password" --hide-text --width=400 --height=200)
- echo "$VAR" | su -S "$1"
- (( $? != 0 )) && zenity --error --text="$ERR " --width=200 --height=130
- exit 0
|