Difference between revisions of "Automount a network drive"

From AwkwardTV
Jump to: navigation, search
m
Line 3: Line 3:
 
The solution is to create a startupitem in /Library/StartupItems/
 
The solution is to create a startupitem in /Library/StartupItems/
  
First of - create a catalog (in this case named "MountStuff" but a name of your choosing chould suffice - rename files/parameters if you change name) containing two files:
+
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
  
File MountStuff containing:
+
<pre>
 +
sudo mkdir /Library/StartupItems/MountStuff
 +
</pre>
 +
 
 +
inside it, make two files:
 +
 
 +
File '''MountStuff''' containing:
  
 
<pre>
 
<pre>
Line 12: Line 18:
 
</pre>
 
</pre>
  
File StartupParameters.plist containing:
+
File '''StartupParameters.plist''' containing:
 
<pre>
 
<pre>
  
Line 23: Line 29:
 
</pre>
 
</pre>
  
Don't forget to sudo chmod +x MountStuff. (:
+
Don't forget to clean up permissions/ownership with something like:
 +
 
 +
<pre>
 +
sudo chmod +x /Library/StartupItems/MountStuff
 +
chown -R root:wheel /Library/StartupItmes/MountStuff
 +
</pre>
 +
 
  
And thats about it! Now it mounts my share(s) on startup.
+
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:
 +
 
 +
<pre>
 +
#!/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
 +
 
 +
</pre>
  
 
[[Category:Network]][[Category:How-to]][[Category:Software]]
 
[[Category:Network]][[Category:How-to]][[Category:Software]]

Revision as of 09:44, 14 August 2008

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