Created
January 27, 2018 07:48
-
-
Save lucascantor/9915c4a9c6deb60fb0a5183e770b5647 to your computer and use it in GitHub Desktop.
Shut down (and require password to unlock FileVault) if .dead_mans_switch hasn't been touched within the past 24 hours
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/bash | |
if [ $(find /Users/<username>/ -mtime -1 -type f -name ".dead_mans_switch" 2>/dev/null) ] | |
then | |
echo "Dead mans switch has been touched today." | |
else | |
echo "Dead mans switch has NOT been touched today. Shutting down now." | |
/sbin/shutdown -h now | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment