Created
December 11, 2016 12:01
-
-
Save brandonpittman/ccb86fe9db05c3b16c2e2446c5537feb to your computer and use it in GitHub Desktop.
Create OmniFocus task to restart Mac if uptime > 7 days
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/awk -f | |
BEGIN { | |
cmd="uptime" | |
cmd | getline output | |
if (output ~ /up ([7-9]|[[:digit:]][[:digit:]]) days/) { | |
system("osascript -e \'tell application \"Omnifocus\" to parse tasks into default document with transport text \"Restart iMac! @home ::misc //"output"\"\'") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment