Skip to content

Minor fix boot-shutdown.sh #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
macosx-script-boot-shutdown
MacOsx-script-boot-shutdown
===========================

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

# Automatic Install and or Uninstall with install.sh

install.sh Is a user ineractif script to be runned as super user. How to use :
- open terminal
- type : cd ~
- type : git clone https://github.com/christophecvr/macosx-script-boot-shutdown
- type : sudo macosx-script-boot-shutdown/install.sh

The script will install the files:

- boot-shut-down-script.plist in path /Library/LaunchDaemons also adapt the target paths into the plist file.
- boot-shutdown.sh in path /library/Scripts this path can be adapted by user during install.
- log path location /Library/Logs this path can be adapted by user during install.

After the install is completed the script will be loaded

This installscript will also check on previous installation.
Give the user the oportunity to stop or choose to remove the service from you're system.
Then the user will be asked to reinstall or not.
After the Install,Uninstall or Reinstall is done you will be asked to remove or not the
git repo from you're pc.

# Manual Install

There are two files:

Expand Down Expand Up @@ -35,6 +59,15 @@ When RunAtLoad is set to false, after the load you must start and stop the scrip
sudo launchctl start BOOT.SHUTDOWN.SERVICE
sudo launchctl stop BOOT.SHUTDOWN.SERVICE

# After changing file boot-shutdown.sh

unload and reload the service in order to have changes directly applied
- open terminal
- type : sudo launchctl unload -w /Library/LaunchDaemons/boot-shutdown-script.plist
- type : sudo launchctl load -w /Library/LaunchDaemons/boot-shutdown-script.plist

Alternatively just restart(reboot) twice and You're changes should be in effect.

## Useful links

- [Daemons and Services Programming Guide][1]
Expand Down
1 change: 0 additions & 1 deletion boot-shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function startup()
}

trap shutdown SIGTERM
trap shutdown SIGKILL

startup;

Loading