[GRASS-dev] making a GRASS script go superuser and asking you a password before running its command

Hello,

Can anybody help/suggest:

While making a script to install GRASS Extensions, i run into a problem.
GEM needs root access to complete its task.

Is there a way to get the script to ask the user for the password and process
under root permission?

thank you
Yann

--
Yann Chemin
Sainte-Anne d'Auray, France

(attachments)

gem_gui1.png

Yann wrote:

Can anybody help/suggest:

While making a script to install GRASS Extensions, i run into a problem.
GEM needs root access to complete its task.

Then the user should run the script as root.

Is there a way to get the script to ask the user for the password and process
under root permission?

Use sudo or "su -c".

Note that if you're relying upon $LD_LIBRARY_PATH to find GRASS
libraries, sudo/su will reset it. You can use $GISBASE/etc/grass-run.sh
to execute a command with LD_LIBRARY_PATH restored.

--
Glynn Clements <glynn@gclements.plus.com>