Created
October 14, 2016 02:04
-
-
Save inC3ASE/2ea44b35747f824ed0a024dbad9c54da to your computer and use it in GitHub Desktop.
libexec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Initialize... | |
# | |
PATH=/bin:/usr/bin:/sbin:/usr/sbin | |
SI_PATH=/System/Library/StartupItems | |
MSG="Shutting down due to power loss!" | |
logger -i -p daemon.emerg -t UPS "${MSG}" | |
# | |
# Take the system down. | |
# | |
if [[ -n $1 && "WaitForUPS" == $1 ]] ; then | |
# | |
# Wait for UPS to take the system down abruptly and unexpectedly. | |
# | |
shutdown -hu now "${MSG}" | |
else | |
# | |
# Gently shutdown the system immediately. | |
# | |
shutdown -h now "${MSG}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment