Home

Awesome

macosx-script-boot-shutdown

This configuration is useful when you need to execute a shell script at Mac OS X boot or shutdown.

There are two files:

# Install

You should customize the following placeholders inside the file boot-shutdown-script.plist:

Then copy the file boot-shutdown-script.plist into /Library/LaunchDaemons/

sudo cp boot-shutdown-script.plist  /Library/LaunchDaemons/

When you want start the virtual machine type the following command:

sudo launchctl load -w /Library/LaunchDaemons/boot-shutdown-script.plist

If you want stop the script (and the you should type the following command:

sudo launchctl unload -w /Library/LaunchDaemons/boot-shutdown-script.plist

The script will be started machine at every host boot. Set into boot-shutdown-script.plist the field RunAtLoad to false if you don't want that the script starts automatically every time your mac os x boots. When RunAtLoad is set to false, after the load you must start and stop the script using the following command:

sudo launchctl start BOOT.SHUTDOWN.SERVICE
sudo launchctl stop BOOT.SHUTDOWN.SERVICE

Useful links