Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How does one make this show up in the finder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How does one make this show up in the finder
Authored by: eoberle on Dec 04, '01 03:53:31PM

Thanks to Xil for the missing piece!!! now I have a little script that rudimentarily allows me to mount my local server. Theoretically, this could be put in Startup items and run automatically, though I'm planning on adding some checking to make sure that the server is not already mounted. (Right now its blind setup and will give errors). At any rate, I thought I'd pass it on to anyone who might be interested. Basically, this is a perl script that can be created by naming it according to the server you attach to (mine is called 'homemount' .) So, copy the following, then go to the unix command line, type pico homemount, do a paste, change the variables appropriately, save and quit, do a 'chmod +x homemount' , and you should be able to load that server with one command. (since it is a bad idea to hard code your server password in, the program prompts you for that)

I'll repost later when I get around to adding in all the checking that probably should be here, but if anyone else wants to do it, I'd be grateful.

best,

Eric


script follows

#!/usr/bin/env perl
##script mounts server volumes
##all variables are right now defined statically, except server password
##which is passed as argument
##from unix command line
## mountserver.pl _serverpassword_
###
###

$server_pass=@ARGV[0];

$local_mount_point='/Volumes/server-drive';
$local_user='eric';
$local_group='admin';

$server_user="eric";
$server_mountpoint="/server";
$server_ip="10.0.2.5";
$server_volume="server";


system ("sudo mkdir $local_mount_point");
system ("sudo chown $local_user:$local_group $local_mount_point");
system ("chmod +rwx $local_mount_point");
system ("sudo mount -t afp afp://$server_user:$server_pass@$server_ip/$server_volume $local_mount_point");
system ("disktool -r");














[ Reply to This | # ]
How does one make this show up in the finder
Authored by: hagbard on Jan 16, '03 08:50:20AM

To add to this great hint, the above examples mount the remote volume as root, and as available to everyone.
Note that you don't have to do it this way.
For example, you could mount a remote volume that'd be only accessible by yourself.

here's how to do this with a directory called disk that's at the root of your home directory.

mkdir disk
mount -t afp afp://user:pass@ip.adress.server/volume_to_mount ~/disk

see how there is no sudo involved in the mount command.
Here, I get a few kextload warnings, but don't mind them.

PS the non-accessibility of ~/disk depends on the permission you've set to your home directory ;-)



[ Reply to This | # ]