Currently Being ModeratedNov 9, 2012 12:47 PM (in response to AdamBritt)
I recommend using AutoFS for this kind of thing: http://images.apple.com/business/docs/Autofs.pdf
According to the script, it will only mount the directory if the desktop Home directory already exists. If the desktop Home directory doesn't exist, it will create it, but nothing more. You need to use "mkdir -p" to always attempt to create the directory. The "-p" flag will allow the program to be successful even if the directory already exists.
You should use $USER instead of that funky awk script. Same goes for $HOME for the home directory. Don't rely on bash either. Really, all you need is:
mkdir -p $HOME/Desktop/Home
mount -t smbfs //10.210.0.13/staff/$USER $HOME/Desktop/Home
But again, AutoFS would be far more elegant.
Currently Being ModeratedNov 9, 2012 1:08 PM (in response to etresoft)
Thanks for the suggestion. I did read over the AutoFS whitepaper in my quest, but I was looking for something specific at the time so I think I will read it over again. I'm new to anything UNIX so this was all hobbled together with pieces I found elsewhere. I will give it a shot Monday morning and let you know how it goes.
Currently Being ModeratedNov 9, 2012 1:13 PM (in response to AdamBritt)
There is another option too. You can mount the volume in the Finder with Go > Connect to Server and then create a alias (drag while holding down option and command) to the volume or anything inside it. Then, when you open the alias, it will automatically mount the network volume. You don't have control over where it mounts the volume in this case, however.
Currently Being ModeratedNov 9, 2012 2:34 PM (in response to etresoft)
You don't have control over where it mounts the volume in this case, however.
Yea, but the volume mounted /Volumes/TheName should show up on the User's Desktop anyway, unless the Finder has been told to not put the volumes on the Desktop.
And a symlink could always put in the Desktop folder that points to /Volumes/TheName.
AutoFS would most likely still be better.
Currently Being ModeratedNov 13, 2012 8:27 AM (in response to etresoft)
I got it working now for the most part. I took the if then statement out of my script and added a line to change the Show Connected Servers option in Finder to on, which solved the problem of the folders disappearing. A few times it acted weird, where a folder would show up twice on the desktop but only one would open. The second icon would do nothing and I couldn't remove it, but it will be something I'll work out later.
Thanks for the help guys.