Re: Why doesn't this sudo script using zenity work??
- From: Stefano Sabatini <stefano.sabatini-lala@xxxxxxxx>
- 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)
_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list
- Follow-Ups:
- Re: Why doesn't this sudo script using zenity work??
- From: William Case
- Re: Why doesn't this sudo script using zenity work??
- References:
- Why doesn't this sudo script using zenity work??
- From: William Case
- Why doesn't this sudo script using zenity work??
- Prev by Date: Why doesn't this sudo script using zenity work??
- Next by Date: Re: I must be missing something...keystroke maneuvering between applications under different virtual desktops
- Previous by thread: Why doesn't this sudo script using zenity work??
- Next by thread: Re: Why doesn't this sudo script using zenity work??
- Index(es):
Relevant Pages
|
|