Results 1 to 10 of 15

Thread: Bash sudo and zenity --password

Threaded View

  1. #1
    Join Date
    Aug 2008
    Location
    Sweden
    Beans
    305
    Distro
    Ubuntu 14.04 Trusty Tahr

    Bash sudo and zenity --password

    Writing an installation-script for Minecraft, been trying to get the user to input password, check password and on wrong password as if the user would like to try again or abort. Finally came up with what seems a working solution (for adding a entry to the application-menu), but now I wonder if this unsafe in any way? Is there a better solution?


    Code:
      while ! zenity --password| sudo -S cat /dev/null >/dev/null; do
        if $(zenity --question --text="Wrong password, would you like to cancel the installation?"); then
          echo "no app-entry made, returning"
          return;
        fi
      done
        echo "$appEntry" | sudo -S tee ${launcher}
        sudo -K # remove privilege
    where appEntry is the text, launcher is the file.

    I might add that I would like to use zenity, not gksu or similar.

    Thanks
    Last edited by DarkAmbient; September 4th, 2012 at 02:09 PM.
    This is my signature

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •