my dotz
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

vpn updoot

+24 -12
+24 -12
bin/zora/vpn
··· 3 3 # connects or kills the gp 4 4 # vpn tunnel 5 5 6 + die() { 7 + notify-send "💀 $1" -t 2000 8 + sleep 1 9 + exit 1 10 + } 11 + 12 + vpn_running() { 13 + pgrep openconnect >/dev/null 14 + } 15 + 6 16 if [ "$1" = "kill" ]; then 7 - notify-send '🤬 killing vpn' -t 2000 8 - sudo pkill openconnect 17 + vpn_running || 18 + die 'vpn is already dead' 19 + notify-send '🔪 killing vpn' -t 1000 20 + sudo pkill openconnect 9 21 else 10 - notify-send '👼 connecting vpn' -t 1000 11 - # the two-line pipe method used here was described 12 - # in this issue: https://github.com/dlenski/openconnect/issues/103#issuecomment-383416545 13 - if pgrep openconnect; then 14 - sleep 1 15 - notify-send '😳 vpn already running' -t 2000 16 - exit 17 - fi 18 - printf "%s\n%s" "$(pa show vpn)" "1" | 19 - sudo openconnect -u jolson --passwd-on-stdin --protocol=gp https://vpn-nyc3.digitalocean.com/ssl-vpn 22 + vpn_running && 23 + die 'vpn is already running' 24 + notify-send '🛡️ vpn connecting' -t 500 25 + # ty katco 🙌 26 + openconnect-gp-okta \ 27 + -username jolson \ 28 + -password-command 'pa show vpn' \ 29 + -vpn-endpoint vpn-nyc3.digitalocean.com \ 30 + -openconnect-args='--reconnect-timeout --csd-wrapper=/usr/lib/openconnect/hipreport.sh' 31 + notify-send '🛡️ vpn connected' -t 500 20 32 fi