Automount a network drive
Revision as of 07:44, 14 August 2008 by Neuralstatic (talk | contribs)
First, thanks to Azral !
The solution is to create a startupitem in /Library/StartupItems/
First off, create a catalog (in this case named "MountStuff" but a name of your choosing should suffice - rename files/parameters if you change name), with a command like
sudo mkdir /Library/StartupItems/MountStuff
inside it, make two files:
File MountStuff containing:
#!/bin/sh /usr/sbin/shlight '//Storage/DISK 2' /Users/frontrow/Movies/disk -U pcguest -P pcguest
File StartupParameters.plist containing:
{ Description = "MountStuff"; Provides = ("Mounts"); Requires = ("Network"); OrderPreference = "None"; }
Don't forget to clean up permissions/ownership with something like:
sudo chmod +x /Library/StartupItems/MountStuff chown -R root:wheel /Library/StartupItmes/MountStuff
And thats about it! Now it mounts my share(s) on startup. (:
alternatively, if you have installed the mount_afp hack, make the MountStuff file contain something of this format:
#!/bin/sh mount_afp "afp://;AUTH=No%20User%20Authent@servername/share" ~/mountpoint/ # for guest log ins mount_afp afp://username:password@servername/ ~/mountpoint/ #for password access