Woohoo, I might be able to help out here. There are a few things to be aware of.
First, make sure you have updated your Synology to the latest DSM. The last few updates have specifically addressed AFP mounting issues.
Second, OSX Mavericks doesn't like it when there are other mounts in the /Volumes/ directory that it isn't directly controlling via Directory Services. Whenever you reboot, it clears out the /Volumes directory. This means the /Volumes/Resources mountpoint holder (the empty directory) doesn't exist and so your mount command will fail. If you insist on it being in this location, you should adjust your first script to create the directory if it doesn't exist. Here is what it should be (but keep reading for a better option)
- Code: Select all
if [ -d "/Volumes/Resources" ];
then exit 1;
else mkdir /Volumes/Resources && exit 1 || exit 0;
fi
So, you should move your Resources mountpoint to a different location. For example, a subfolder within your own home folder. If you have multiple user accounts on your Mac and you want all users to be able to access the mount, don't mount it in your home dir as they won't have access. You should mount it at /Users/Shared/Resources since everyone has access to /Users/Shared/.
One side issue here is that the mounted volume icon will not appear on the Desktop. If you want it there, make an alias of it from the /Users/Shared/ folder onto your desktop.
Finally, a good option for this scenario is to stop using your scripts and configure the mount using the OSX automount system. If you attempt to access the directory where the share is mounted and it isn't, the automount will automatically mount it for you! (aren't computers amazing?!?)
To do this, you will need to be a bit more comfortable with Terminal and the command line. I'll assume that you are not and will be using some simplified commands and editors.
I will assume that your computer is only for you and you don't have multiple user accounts. So instead of the share being mounted in the /Users/Shared/ folder, we will mount it into your own home directory (and I'm assuming your username is 'Woohoo')
Create an empty folder named 'Resources' in your home folder.
- Code: Select all
cd ~
mkdir Resources
Now create an automount map file for your network share. Since it needs to be done with the root user, we will use sudo. When you run the command, it will ask for your password.
- Code: Select all
sudo nano /etc/auto_synology
This creates a new file and places you into the nano text editor. Simply copy/paste the following line, which is a simple example of mounting the Synology public share as a guest user. Obviously this will only work if you have your Synology 'public' share available to guest users.
- Code: Select all
/Users/Woohoo/Resources afp://;AUTH=No%20User%20Authent@NAS._afpovertcp._tcp.local/public
If you have set up your Synology with users and passwords, you will want to use this line instead. Substitute the username:password part as necessary.
- Code: Select all
/Users/Woohoo/Resources afp://username:password@NAS._afpovertcp._tcp.local/public
Once you have pasted one of the above lines, press control+x to exit out of nano. When you do, it will ask if you want to save the file. Answer Y and it will then ask for the file to save, which it will already have '/etc/auto_synology' added in for you so just press Return.
Now we will need to edit the automount master file to tell it about your new map file.
- Code: Select all
sudo nano /etc/auto_master
It will probably look like this
- Code: Select all
#
# Automounter master map
#
+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/- -static
Simply add the following to just above the +auto_master line.
- Code: Select all
/- auto_synology
So the completed file should look like this
- Code: Select all
#
# Automounter master map
#
/- auto_synology
+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/- -static
Like before, press control+x to exit/save
Now tell automount to reload the configuration.
- Code: Select all
sudo automount -cv
Run the mount command to see the list of mounted shares.
- Code: Select all
mount
If everything was done correctly, you should see the automount map entry and the public mounted share onto your home/Resources folder.
- Code: Select all
map auto_synology on /Users/Woohoo/Resources (autofs, automounted, nobrowse)
//Woohoo@NAS._afpovertcp._tcp.local/public on /Users/Woohoo/Resources (afpfs, nodev, nosuid, automounted, nobrowse, mounted by Woohoo)
Switch back to the Finder, go into your home dir and open the Resources folder. Hopefully you see the files from your Synology public share.
Now go disable your previous mounting scripts

I hope this helps.