audax321
November 2nd, 2005, 10:22 PM
Hello,
I'm writing a shell script right now that needs to run a command as root using gnome-sudo. This one line is executed in a function and its execution is to be followed by another function. The problem I have is that the first function is exiting as soon as gnome-sudo runs instead of waiting for the command that gnome-sudo is running as root to finish. So the function following the first one is not working.
e.g.
MOUNT_ISO()
{
gnome-sudo -m "Enter password for root access." -t "Got r00t?" "mount -r -o loop "$1" /media/Filesystem\ Image" &
}
PROCESS_ISO()
{
#do stuff
}
# MAIN SCRIPT CODE
MOUNT_ISO "$1"
PROCESS_ISO
So, in the above, MOUNT_ISO is being called, but the function exits and calls PROCESS_ISO before the ISO file has even finished mounting.
What I need it to do is completely mount the iso before calling PROCESS_ISO.
Thanks for any help with this. :???:
I'm writing a shell script right now that needs to run a command as root using gnome-sudo. This one line is executed in a function and its execution is to be followed by another function. The problem I have is that the first function is exiting as soon as gnome-sudo runs instead of waiting for the command that gnome-sudo is running as root to finish. So the function following the first one is not working.
e.g.
MOUNT_ISO()
{
gnome-sudo -m "Enter password for root access." -t "Got r00t?" "mount -r -o loop "$1" /media/Filesystem\ Image" &
}
PROCESS_ISO()
{
#do stuff
}
# MAIN SCRIPT CODE
MOUNT_ISO "$1"
PROCESS_ISO
So, in the above, MOUNT_ISO is being called, but the function exits and calls PROCESS_ISO before the ISO file has even finished mounting.
What I need it to do is completely mount the iso before calling PROCESS_ISO.
Thanks for any help with this. :???: