BerSerK has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to create a simple web page that lists the ISO files I have in a directory so I can select one file and click a button to mount that file in a preconfigured directory. I'm stuck at mounting the file with perl, I need sudo and I don't know if it's possible to do that from a script. I basically have a php file outputting a form, on that form I select what file I want to mount and click 'submit', I post the info to /cgi-bin/discmount.pl. Dismount.pl should mount to /media/vdrv0 which is shared by samba. Anyone can help me with the mounting part if it's possible ? Thanks

Replies are listed 'Best First'.
Re: Perl script to mount iso file
by Joost (Canon) on Dec 17, 2007 at 16:47 UTC
      I only need one mount at a time but how could I change which iso file is mounted from my php form...I would have to copy the desired iso file to /tmp/isofile each time ?
Re: Perl script to mount iso file
by dwm042 (Priest) on Dec 17, 2007 at 20:09 UTC
    #I need sudo and I don't know if it's possible to do that from a script.

    Yes, you can. sudo has a NOPASSWD option. Check the sudoers manual here.