Skip to content

Instantly share code, notes, and snippets.

@fourlastor
Created April 17, 2017 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourlastor/0516e2cae24cf8f470ac4c9828a66e29 to your computer and use it in GitHub Desktop.
Save fourlastor/0516e2cae24cf8f470ac4c9828a66e29 to your computer and use it in GitHub Desktop.
NordVPN
#!/bin/bash
# usage: nordvpn [server=nl21] [protocol=udp|tcp]
nordvpn() {
default_server="nl21"
default_protocol="udp"
# folder where you extracted the openvpn config files from https://nordvpn.com/api/files/zip
config_location="{$HOME}/path/to/your/config/folder"
server=${1:-$default_server}
protocol=${2:-$default_protocol}
if [ "$protocol" = "udp" ]; then port="1194"; else port="443"; fi
sudo openvpn --config "${config_location}/${server}.nordvpn.com.${protocol}${port}.ovpn" --auth-user-pass "${config_location}/auth_user_pass"
}
# be sure to add a file named auth_user_pass in your config folder
# it must contain your nordvpn email in the first line and your password in the second line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment