usu 554 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 try again later"; echo)
  5. VAR=$(zenity --entry --title="$TITL" --text="$MESS" --entry-text "password" --hide-text --width=400 --height=200)
  6. echo "$VAR" | su -S "$1"
  7. (( $? != 0 )) && zenity --error --text="$ERR " --width=200 --height=130
  8. exit 0