Last active
June 15, 2019 21:07
-
-
Save sebandgo/77cfe3336754fac9452d7a57d764b6d4 to your computer and use it in GitHub Desktop.
Mac CronJob to open and close specific applications
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
## | |
## Open Applications ## | |
## | |
59 5 * * * printf '3\n[USERNAME]\n[PASSWORD]\ny' | /opt/cisco/anyconnect/bin/vpn -s connect [VPN-HOSTNAME] > /dev/null 2>&1 | |
0 6 * * * osascript -e 'open app "Slack"' > /dev/null 2>&1 | |
0 6 * * * osascript -e 'open app "Fuze"' > /dev/null 2>&1 | |
0 6 * * * osascript -e 'open app "Cisco AnyConnect Secure Mobility Client"' > /dev/null 2>&1 | |
## | |
## Close Applications | |
## | |
59 22 * * * /opt/cisco/anyconnect/bin/vpn disconnect > /dev/null 2>&1 | |
0 23 * * * osascript -e 'quit app "Slack"' > /dev/null 2>&1 | |
0 23 * * * osascript -e 'quit app "Fuze"' > /dev/null 2>&1 | |
0 23 * * * osascript -e 'quit app "Cisco AnyConnect Secure Mobility Client"' > /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment