mounting network share

pyrojoe333

Registered
I'm working on mounting a network shae via the terminal. I need to write a login script. The way this works is every user has a folder on our server so that every time they log in they can save stuff to their folder. I wlould like to mount this foulder via login script so when they log in this folder appears on their desktop. right now I'm using mount_smbfs as my command and it works kinda. if I type: mount_smb -u stu000001 -d my_domain //labserver/student1/stu000001 ./student it mounts //laserver/student1 and excludes the stu000001 folder. I think it might be because this folder is a folder not a share? what I'm asking is does anybody know how to mount a remote folder or any way to fix this problem other than making the folder a share, and is there a way to do it in command line. OR how would I do it using apple scripts? and how would I set up apple scripts as a login hook?

Jeramiah
 
If it mounts //laserver/student1 then make a sym-link to the stu000001 folder inside that mount. You'll only need to make the sym-link once, then when student1 is mounted the sym-link will resolve properly to the correct folder. This is just one idea, might not be the best.
 
try writing an apple script

i did

Code:
tell application "Finder"
	try
		
		mount volume "smb://domain;username@netbios/share"
		
	end try
end tell
that will promt for a password if needed or you can set up a .nsmbrc file to bypass the password.

search the forums
 
I think you're only exporting student1 in the smb config. So there's 2 ways you can approach this:

* The way I described above, after mounting the student1 folder, check to see if a sym link exists that will point to the user's folder within student1, create it if it doesn't exist.

* Create a script that will update you smb config on the server side. This way whenever you have a new user, or want to run a batch to create many users, it'll update the smb config by adding the student00000# folder to the shares exported. I'm basically saying, make a tool that'll go and make the shares for you rather than manually make them by hand.
 
or for something a bit different

connect to you share. then navigate to the folder you want to get, and make an alias of it on the desktop. now when you click the icon, share will mount automatically if not mounted. for more effect, disable network volumes showng up on your desktop
 
Right what I want to do is write a script. that will run when my user logs in. the script will look at the users name and find the folder on the server with that same name (i.e. mount //labserver/student1/%username%, or something to that effect). The problem that I'm having is finding the command the will mount the folder. I believe that the problem lies in that the users folder is just that, it's a folder within a share. it's mounting the share but not the folder that I specify. I can't make this folder a share on the server side, I need to figure out how to mount in on the client side.
 
Is there a way to create an alias to the users folder on the desktop after I've mounted the drive? So then the user logs in, I mount the //labserver/student1 then I create an alias on the desktop that points to stu000001. In applescript or otherwise?
 
ln -sf //labserver/student1/stu000001 ~/Desktop/share

That's the shell command to create a symbolic link to //labserver/student1/stu00001 and put the link on the desktop. "share" will be the name of the alias. I used "//labserver/student1/..." as an example, you'll have to find the absolute path that it's mounted at.
 
Back
Top