Funnily enough, just last week I wrote a little howto on this (see my website in my signature for more info). The reason for the problem you're experiencing is that while most *nix distributions work fine when the setuid bit on a binary is turned on, the distributions specifically disable the use of setuid bits on shell scripts, due to their insecure nature.
There are two possible workarounds: a) edit the sudoers file so that sudo doesn't require a password for the commands that you need to execute in your shell script, or b) call the script from a C program using the system() call.
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
Offline 5,055 posts
since Apr 2006