Re: Why doesn't this sudo script using zenity work??
- From: Stefano Sabatini <stefano sabatini-lala poste it>
- To: gnome-list gnome org
- Subject: Re: Why doesn't this sudo script using zenity work??
- Date: Fri, 1 Dec 2006 12:05:10 +0100
On date Friday 2006-12-01 05:02:30 -0500, William Case wrote:
> Hi;
>
> I have tried several variations of the following script and googled for
> some clues. No joy.
>
> #! /bin/bash
> # Open nautilus as root
> #
>
> sudo nautilus --no-desktop --browser
> if zenity --entry \
> --title="Browse files as root" \
> --text="Enter your _password:" \
> --entry-text "" \
> --hide-text
> then echo $?
> else echo "No password entered"
> fi
>
> # End
>
> sudo nautilus --no-desktop --browser works on the command line.
> Why doesn't this sudo script using zenity work??
Because you need sudo to read the password passed by zenity on stdout.
So you have to do:
zenity --entry \
--title="Browse files as root" \
--text="Enter your _password:" \
--entry-text "" \
--hide-text \
| sudo -S nautilus --no-desktop --browser
then control the return code of sudo to check that the password
entered was correct.
HTH
Regards
--
Stefano Sabatini
Linux user number 337176 (see http://li.count.org)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]