PDA

View Full Version : mounting shares automatically- Terminal?


chardinej
01-27-2002, 03:50 PM
I know how to mount a SMB share using Terminal and would like to automate the process at login. Can you save Unix Terminal commands and have them run at startup?

mervTormel
01-27-2002, 05:36 PM
Originally posted by chardinej
I know how to mount a SMB share using Terminal and would like to automate the process at login. Can you save Unix Terminal commands and have them run at startup?

i believe so, but there may be timing issues related to what else is running at startup.

get your shell script working well.

name it with a .command extension, e.g., mountShares.command

that makes it a finder launchable script.

add that in your login startup items.

let us know how it works.

chardinej
01-27-2002, 09:35 PM
Thanks, I'll try this. Just to be clear, the "shell script" is whatever I type into Terminal (in this case the Mount command, or something like that). I then make a text file with the script in it, and name the file something.command. Then add the file to the login items.

Have I got this correct?

Many thanks again.

John Chardine

mervTormel
01-27-2002, 09:56 PM
yep. i think you've got it.

also, you have to make the script executable, like so

% chmod u+x somefile.command

for example, this is a finder runable script that could be run on login to renice the windowserver


% ll znice.command
-rwxr--r-- 1 user staff 125 Jan 27 18:47 znice.command*

% cat znice.command

#!/bin/sh

# znice - my renice priority wrangling

sudo renice -10 -p `ps -ax | grep -i '[w]indowserver' | awk '{print $1}'`