usu 678 B

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