Mac Thread, mount_smbfs scripting help in Technical; Right, following on from my previous thread, I've found that changing some permissions and hiding the Movies/Pictures/Downloads/etc folders after mounting ...
28th November 2012, 12:13 PM #1
mount_smbfs scripting help
Right, following on from my previous thread, I've found that changing some permissions and hiding the Movies/Pictures/Downloads/etc folders after mounting the home drive direct to the ~/Documents folder makes everything work.
The kids are now forced to save into their ~/Documents folder which is mounted directly to their home share on a windows server.
I mount the drive to ~/Documents using the following command:
this works fine while I'm testing it in terminal, but adding that to a login script gives the following error:
mount_smbfs smb://server/hiddenshare$/$USER ~/Documents
Any ideas where I'm going wrong. I'm sure it'll be massively obvious!
mount_smbfs: mount error: /Users/USER$/Documents: No such file or directory
28th November 2012, 12:54 PM #2
Is the script getting confused by the $ symbol? It might be that in the script context, the variable that has the username isn't set properly.
You might also need to look at wether the $ signs are there because the share is hidden, or if its a variable that should be substituted.
28th November 2012, 01:01 PM #3
The error means exactly what it says, ~/Documents doesn't exist for a users first login until it's created long after a successful login by the gnome shell (or whatever). To fix this add a Documents directory with the correct permissions to /etc/skel (I assume you're running a full PAM login?). Any botched home directories will need to be fixed manually (or just nuke the home directories if there's nothing there).
Last edited by Geoff; 28th November 2012 at 01:05 PM.
29th November 2012, 03:32 PM #4
I worked it out, needed to look like this:
mount_smbfs smb://$user@server/hiddenshare$/$USER ~/Documents
By FN-GM in forum Web Development
Last Post: 19th August 2008, 02:52 PM
By djones in forum Scripts
Last Post: 13th March 2008, 06:00 PM
By chrisa in forum Scripts
Last Post: 7th March 2008, 04:34 PM
By russdev in forum Scripts
Last Post: 8th August 2007, 05:34 AM
By woody in forum Scripts
Last Post: 5th October 2005, 11:37 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)