exactly i want to make a script and add this to shortcut launcher...
when i double click the icon, it will popup a terminal window (done)
in terminal, it will ask root password at first..
and then do some stuff with root privilege (i make it as a function) ..
after that, in the end of script it will close the window
like "press anykey to close window" (i can do it)
#!/bin/sh
touchpad(){
whoami
}
sudo -S touchpad # but it return error "command not found"
how to run a function as root user?
or there is another way to do this?
EDIT :
i'v try this
#!/bin/bash
sudo ./main2.sh #this not work when i make it as a launcher
exit
this is my current code (after googling):
#!/bin/bash
gksudo -m "Input Password" clear
sudo whoami
#sudo bla bla bla
read -n 1 -p "Press any key to close window"
this is what i want, but got error if i type wrong password for 3 times..
how to force quit main window if gksudo fail??
