Posted on 11-01-2012 08:46 AM
I used the mountNetworkShare.sh script from the Resource kit and modified it a bit to work for my 10.7 clients as a login policy. It pulls in the username, share (defined in the policy), and volume name (defined in the policy) to make a folder in the UserHome and set it as the mount point. All has worked well in 10.7, however 10.8 is not working at all. Currently, at logon - the directory is made in the user home, remains empty, but in the sidebar of Finder, it appears the server is mounted at the root (but not down to the mount point and is therefore incapable of being navigated). Has there been a change in Kerberos Auth? The users use their AD creds to log in to the machine.
This is the script currently being run:
username="$3"
share="$4"
volumeName="$5"
if [ -d "/Users/$username/$volumeName" ]; then
result=ls -A /Users/$username/$volumeName
if [ "$result" == "" ]; then
echo "Removing Empty Directory: /Users/$username/$volumeName..."
rmdir "/Users/$username/$volumeName"
else
echo "Error: Directory /Users/$username/$volumeName is not empty."
exit 1
fi
fi
sudo -u "$username" mkdir /Users/"$username"/"$volumeName"
command="/sbin/mount_smbfs $share /Users/$username/$volumeName"
echo $command
su -l "$username" -c "$command"
exit 0
Posted on 11-01-2012 06:26 PM
Found some more wonkiness.
Removing the "-l" in the last line of the script (sudo -l) allows the script to run. Once this runs (as long as it happens first), the above script can run again WITH the "-l" still in the script (defining variables differently).
However, if i remove the "-l" from this script and then run this multiple times (different variable definitions), they all fail.
Scratching my head...