Mount / Script Question
I would like to create a script that will mount my ipod and then run gtkpod all in one shot.
The problem is that the mount command requires root priveleges. Is there anyway I can make the script autologin as root? Thanks! |
Quote:
In short, no, there's no way for a script to run with root priviledges unless root executes it. The script can run "su" inside to gain root priviledge, but that will require user interaction to enter the root password. In my opinion, aside from the annoyance of entering the password everytime you run the script, having a script gain root privledges is a bad call. It would be better to use sudo for this. Actually, you can eliminate all this root priviledge business by editing your /etc/fstab file. If you add "user" to the comma-separated list of options for your ipod entry, then a regular (i.e. non-root) user can mount and unmount the device at will. Here's an example using the entry I have for a USB pendrive: Code:
/dev/pendrives/lexar /media/pendrive vfat noauto,rw,user 0 0 Code:
#!/bin/bash |
All times are GMT -5. The time now is 06:01 AM. |