I have been trying to find the proper way how to let a script have root permission. But haven't found an answer. I am trying to make it easier for people using the Awoken-Icon-theme changing the /usr/share/pixmaps/ icons. And am pretty much finish with the gui. I don't want the user needing to open an terminal and do sudo gainroot. Even better if Rootsh wasn't needed at all. Right now all my solutions ends up in the use/installation of rootsh. Is there a way passed this? Like the use of a sudoers file in "/etc/sudoers.d/". If i make this file it doesn't seam to recognize it. It still gives be permission denied when doing "/usr/bin/script". Same goes for if i am putting: Code: if [ `id -u` != 0 ]; then root<<EOF /usr/bin/python /home/user/.scriptfolder/script.py EOF exit $? fi or any other incarnation of this. This works if the user have Rootsh installed though. But what if he don't? Also what is the proper way of giving "chmod +x"? Does it keep the executable permission through an install/upgrade? I do not have scratchbox .. am doing all the testing on the n900.
if [ `id -u` != 0 ]; then root<<EOF /usr/bin/python /home/user/.scriptfolder/script.py EOF exit $? fi
if [ `id -u` != 0 ]; then exec root<<EOF exec /usr/bin/python $0 $* EOF exit $? fi