Skip to content

Instantly share code, notes, and snippets.

View zxlin's full-sized avatar

Toby Lin zxlin

  • United States
View GitHub Profile
@zxlin
zxlin / auto_connect_globalprotect.sh
Last active May 10, 2024 16:08
Automatically Connect to GlobalProtect VPN on MacOS Wakeup
#!/bin/bash
# Toggle GlobalProtect VPN with AppleScript and automatically close the landing page in Chrome
# Adapted from Trevor Manternach https://gist.github.com/tmanternach/cbd4c213eab8569e38d6cd021b6255e5
# Tested using macOS Sonoma 14.4 and GlobalProtect version 5.2
# Use sleepwatcher `brew install sleepwatcher` and configure a bash script in `~/.wakeup` to run this script.
# Make sure to provide accessibility permissions to the sleepwatcher binary for the applescript to work.
# Update the GP_URL if your GlobalProtect's landing page has a different URL or make it more specific
### Keybase proof
I hereby claim:
* I am zxlin on github.
* I am zxlin (https://keybase.io/zxlin) on keybase.
* I have a public key ASAa5_H6negJaaSXTVemcTXZwTxs2jmHyJCCrZTM0jz_Zgo
To claim this, I am signing this object: