Created
September 2, 2016 19:03
-
-
Save ttaylorr/9b7cc4e743e1b5424afec46e59a87a49 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
if [ ! "root" -eq "$(whoami)" ]; then | |
echo "Unable to keep display awake when not running as 'root'." | |
echo "Try \`sudo !!\` to run this command again as root." | |
exit 1 | |
fi | |
echo "[*] Keeping display awake..." | |
while true; do | |
pmset schedule wake "$(date -v+1M "+%D %T")" | |
sleep 60 | |
done | |
echo "[*] Goodnight." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment