0

I'm trying to figure out how to get two shell scripts to run automatically. One script to run when the mac is turned on. And another to run when the computer is about to shut down.

I'm guessing for launching, I should use launchd? Or is that overkill? I just need to run a self contained script, no variables being passed in. If so, any good references?

I can't seem to find a simple solution for running a script when the computer is shutting down. Any suggestions?

Thanks.

2
  • Might want to modify the title to include the HUGE game changer fact in this post. "MAC"
    – user76211
    Commented Jun 10, 2011 at 23:03
  • Thanks. On stackoverflow I've been told not to put tags in the title. Oh well.
    – RyanJM
    Commented Jun 13, 2011 at 14:25

1 Answer 1

0

I am unfamiliar with Mac OSX but it appears that instead of the traditional /etc/rc2.d it has /Library/StartupItems - you can place a startup script there (see random Internet blog or ancient Mac blog)_

By guesswork I'd expect /Library/ShutdownItems. However some people suggest adding commands to /etc/rc.shutdown.local.

But maybe you should wait for an answer from someone who actually knows about MacOSX :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .