PDA

View Full Version : auto execute terminal commands at startup


gennaria
04-03-2002, 03:04 PM
Forgive me if the answer is obvious...

I am currently using my G4 tower with Airport card as a base station for my TiBook. Both are running OSX. Everytime I restart the G4 tower I have to open the terminal type a command and then the tower will begin acting as a router to the TiBook. Not a big deal, but it would be great to be able to have this happen automatically at startup. Is there a special kind of script that does that sort of thing?

Thanks,
jerry gennaria

eriklager
04-03-2002, 03:17 PM
Yoy can make a startup item and put it in the StartupItems folder. You can get information about creating startup items here (http://www.opensource.apple.com/projects/documentation/howto/html/SystemStarter_HOWTO.html). You could also make an applescript and add it to the Login Items in the System Preferences Login pane.

Erik

mervTormel
04-03-2002, 03:41 PM
you could also put the commands into a shell script, name the script with the .command extension, and put that into your system preferences->login items. that would avoid the applescript overhead.

jmeador
04-03-2002, 04:01 PM
Suppose you wanted the command to run automatically on
reboot -- before someone logged in?

For example, Let's say I have a server that always needs a route added on power-up. If the system reboots because power loss on Friday night, would the Startup items run when power came back on Friday or when someone actually logged in Monday morning?

mervTormel
04-03-2002, 04:31 PM
to stage a user-installed startup item for boot-time, you'd need to get the scriptage into "/Library/StartupItems/yourTask"

as erik noted above, there is a how-to at:

http://www.opensource.apple.com/projects/documentation/howto/html/SystemStarter_HOWTO.html