Skip to content

This project is useful to execute a shell script during Mac OS X boot or shutdown.

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.txt
Notifications You must be signed in to change notification settings

freedev/macosx-script-boot-shutdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:

  • boot-shutdown-script.plist
  • boot-shutdown.sh: bash shell script

# Install

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

  • BOOT.SHUTDOWN.SERVICE : If you don't know, leave it as is
  • SCRIPT_PATH : the path where the boot-shutdown.sh script is stored.
  • LOG_PATH : the path where the logs are stored. If you don't care about logs, use: /tmp

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

About

This project is useful to execute a shell script during Mac OS X boot or shutdown.

Resources

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages