Jump to content

Recommended Posts

Posted

Hi all,

 

We have Macs (OS X 10.6.8) bound to AD/OD in the "Golden Triangle" setup, with workgroup manager on OS X 10.6.8 server managing some preferences. We have successfully managed to map staff and student shares through the login items preference on workgroup manager, mounting the drives to the desktop on user login.

 

My issue is with mounting Windows home directories. Using the Automator application on a Mac client I built an app called HomeFolder.app that runs the shell script below, which WILL mount the home folder on the desktop (obviously this script is for staff accounts only)

 

#!/bin/bash

#pause for kerberos ticket

 

#/bin/sleep 15

 

#get current logged in user

 

cur_user=`/bin/ls -l /dev/console | awk '/ / { print $3 }'`

 

#input full path of home folder

 

home_folder="/Volumes/Home$/staff/$cur_user /Users/$cur_user/Desktop"

 

#now make sure it is mounted

 

if [[ -e $home_folder ]]

 

then /bin/echo "home folder is mounted"

 

else /sbin/mount_smbfs //10.0.48.39/home$/staff/$cur_user /Users/$cur_user/Desktop

 

fi

 

/bin/echo "done"

 

exit 0

 

I've then placed the app in the login items on a Mac client under System Preferences > Accounts > Login Items and taken a copy of the com.apple.loginitems plist from ~/Library/Preferences. I then placed it in workgroup manager > details. (this is how we have customised the dock, for example) with the hope that the app will run upon login.

 

When I log on to a Mac client as a member of staff, the applications doesn't seem to run as there's no home folder mounted on the desktop. Does anyone know what I might be doing wrong here? the application will run fine manually. This method must seem really ridiculous, but I've exhausted all other possibilities!

Posted

In WGM there's a spot to specify login items, it might work better than trying to add it as you did. I think it's Preferences->Login->Items.

 

Also make sure that there is a copy of the app on all the local machines (login items want to run from a specific local path). In my case I put them all into a subfolder in /Users/Shared on each of my lab machines. I did something similar but I did it with a straight Applescript app (to mount student shares) and it worked out ok for me.

 

Lastly a suggestion, try using the command "whoami" instead of looking to the console. I've seen some strange things happen with console in the past. whoami should always return the shortname of the currently logged in user (and if it doesn't it might give you some extra info for debugging).

 

Hope this helps.

  • Thanks 1
Posted

Thanks for the reply.

 

I've tried using Preferences>Login>Items before, but I didn't place the app in the /Users/Shared folder of the clients. I'll give it a go!

 

Also I didn't have any luck creating an apple script with the script I've got, as it kept returning "unknown token" errors for a lot of the characters in the script and then errors such as "expected 'then' but found 'else'". I gave up and used the automator application to package the shell script in to an application. Could you possibly post the script you used? Maybe I can see where I'm going wrong!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...