123456789 |
- #!/bin/bash
- MESS=$(echo -e "'$1' is attempting to perform an \n action that requires 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 check your password and try again"; echo)
- VAR=$(zenity --entry --title="$TITL" --text="$MESS" --entry-text "" --hide-text --width=400 --height=200)
- echo "$VAR" | sudo -S -k $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20} ${21} ${22}
- (( $? != 0 )) && zenity --error --text="$ERR " --width=200 --height=130
- exit 0
|