Skip to content

Instantly share code, notes, and snippets.

@freemandealer
Last active June 28, 2020 03:59
Show Gist options
  • Save freemandealer/8f9fc523ada3a8e319ef7866f511130b to your computer and use it in GitHub Desktop.
Save freemandealer/8f9fc523ada3a8e319ef7866f511130b to your computer and use it in GitHub Desktop.
Android tasker pseudo script to automate vpn on/off when using Chrome
# turn on chrome
if VPNISON ~ 0
connect vpn
set VPNISON 1
wait 30sec // wait 30 sec and set disconnectable to avoid frequent on/off
set VPNISON 2 // disconnectable
endif
# turn on others (turn off chrome)
if VPNISON ~ 2
disconnect vpn
set VPNISON 0
stop
# give this app another chance to switch off VPN
# if hadn't been off when start
wait 30sec until VPNINON ~ 2
if VPNISON ~ 2
disconnect vpn
set VPNISON 0
set VPNISON 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment