The script for version 5 is the same as for version 4. Just replace the version numbers.
The script should be part of the init.d / rc.d scripts - and could then be automaticly started and stopped when entering / exiting specific runlevels.
This ain't a cgi script for a webserver, so password protected directory's isn't an option. Password protected diretory's isn't really security anyway - it's just a webserver feature. Only root should be able to start daemons, and daemons (especially 3. party daemons without sourcecode) should never run as root. That is the reason for the sudo'ing.
This isn't a script for your webpage. It's a plain perl script for shell execution.
-Sticky bit