Skip to content

Instantly share code, notes, and snippets.

@charliecf
Created May 9, 2017 04:51
Show Gist options
  • Save charliecf/c78fc452208dd7cfd44cf1b0b6ea9fbb to your computer and use it in GitHub Desktop.
Save charliecf/c78fc452208dd7cfd44cf1b0b6ea9fbb to your computer and use it in GitHub Desktop.
Tunnel Bear VPN via OpenVPN (for Linux)
#!/bin/bash
# VPN access through tunnel bear
# sudo systemctl start openvpn-client@TunnelBearJapan.service
echo "Tunnel Bear VPN"
HEIGHT=26
WIDTH=40
CHOICE_HEIGHT=20
BACKTITLE="TunnelBear VPN via OpenVPN"
TITLE="TunnelBear Countries"
MENU="Choose which country to tunnel to..."
OPTIONS=("UnitedStates" "<"
"Canada" "<"
"Australia" "<"
"Brazil" "<"
"Denmark" "<"
"France" "<"
"Germany" "<"
"HongKong" "<"
"Ireland" "<"
"Italy" "<"
"Japan" "<"
"Mexico" "<"
"Netherlands" "<"
"Norway" "<"
"Singapore" "<"
"Spain" "<"
"Sweden" "<"
"Switzerland" "<"
"UnitedKingdom" "<")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
echo $CHOICE
echo "initating VPN tunnel to $CHOICE"
systemctl start openvpn-client@TunnelBear$CHOICE.service
figlet VPN to...
figlet $CHOICE
echo "Type to end all this"
read STOP
echo "stopping VPN to $CHOICE"
systemctl stop openvpn-client@TunnelBear$CHOICE.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment