+ Post New Thread
Results 1 to 4 of 4
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 ...
  1. #1
    ben604's Avatar
    Join Date
    Jan 2010
    Posts
    314
    Thank Post
    81
    Thanked 29 Times in 24 Posts
    Rep Power
    23

    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:

    Code:
    mount_smbfs smb://server/hiddenshare$/$USER ~/Documents
    this works fine while I'm testing it in terminal, but adding that to a login script gives the following error:

    Code:
    mount_smbfs: mount error: /Users/USER$/Documents: No such file or directory
    logout
    Any ideas where I'm going wrong. I'm sure it'll be massively obvious!

  2. #2

    Join Date
    Sep 2008
    Location
    England
    Posts
    278
    Thank Post
    6
    Thanked 70 Times in 62 Posts
    Rep Power
    53
    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.

  3. #3

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227
    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 02:05 PM.

  4. #4
    ben604's Avatar
    Join Date
    Jan 2010
    Posts
    314
    Thank Post
    81
    Thanked 29 Times in 24 Posts
    Rep Power
    23
    I worked it out, needed to look like this:

    Code:
    mount_smbfs smb://$user@server/hiddenshare$/$USER ~/Documents



SHARE:
+ Post New Thread

Similar Threads

  1. PHP script help
    By FN-GM in forum Web Development
    Replies: 18
    Last Post: 19th August 2008, 03:52 PM
  2. Logon Script Help
    By djones in forum Scripts
    Replies: 17
    Last Post: 13th March 2008, 07:00 PM
  3. Proxy Authentication Script - HELP!!!!!
    By chrisa in forum Scripts
    Replies: 9
    Last Post: 7th March 2008, 05:34 PM
  4. AutoIt Script Help - Get Last Changed File
    By russdev in forum Scripts
    Replies: 8
    Last Post: 8th August 2007, 06:34 AM
  5. One PC refuses to run script! Help!!!
    By woody in forum Scripts
    Replies: 6
    Last Post: 5th October 2005, 12:37 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •