Connecting with different users to 1 server (2)

This is a simple followup after my last post. Pim did also look into this, and made a script which doesn’t pop up finders by simply calling “mount”. There is only one minor glitch: the script pops up an error when the mount already exists. With my brilliant programming expertise, I quickly solved that:

try
	mount volume "cifs://KAGE/iTunes" as user name "iTunes" 
                                          with password "yourpasswordhere"
	mount volume "cifs://KAGE/incomming" as user name "Guest"
	mount volume "cifs://KAGE/foto" as user name "Guest"
on error errText number errNum
	(* Not the nice way, simply ignore errors. If the mount did
	   not work, the user needs to see what is going on. How?
	   Use Finder to mount, and it will give you the error *)
end try

This script will try to mount the drives, ignoring errors. Replace the servernames, usernames and passwords with your own. What you can do is run the script at logon, or every minute in a cron job. I checked /var/log/system.log, but the script does not generate errors there.

At the rate we’re going, maybe we’ll even solve the “re-mount drives on return from sleep” problem. Let’s see if we can find a wakeup event on which we can run the script.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s