A toolkit of scripts for easing the use of NordVPN with OpenVPN in command line.
NOTE: This script is dependent on the currently available endpoints for fetching required data from NordVPN's website. If they change them, these scripts will break.
NOTE: For now this does not support global installation and should only be run directly by the built script files from the repository directory.
Here are the included scripts and what they do.
Script: bin/get-connection-status
Will make an request against the NordVPN get_user_info_data
endpoint and return wether connected to NordVPN or not. Script will exit with code 0
or connected to NordVPN, otherwise it will exit with code 1
.
--minimal
- Will printCONNECTED
orNOT_CONNECTED
depending on connection status. In case of error such as no internet connection this will printERROR
.--silent
- Will not print anything and only exit script with exit code0
or1
, see description above.
$ bin/get-connection-status
Status: connected
Location: Sweden, Stockholm, Stockholm
IP address: 195.181.166.95
ISP: Datacamp Limited
Coordinates: 17.9448 59.4032
Script: bin/get-recommended-server-config
Will fetch and output the OpenVPN config contents of a recommended server. The NordVPN recommended servers endpoint returns top 5 servers for given country.
--country <country-code>
- ISO 3166-1 alpha-2 country code format. Defaults toDEFAULT_COUNTRY
in.env
file.--offset <offset>
- Pick server in recommended servers list with offset. Valid values0 - 4
. Defaults to0
.--auth-file <path-to-auth-file>
- Path to auth file to be included in the config file. Defaults toAUTH_FILE
in.env
.
$ bin/get-recommended-server-config --country SE --offset 2 > nordvpn-config.conf
(Fetches config content for recommended server nr 3 for Sweden and writes it to nordvpn-config.conf
)
- Ensure dependencies
- Install dependencies
yarn
- Set up
.env
file, use.env.sample
as template
Creates a build of the project
Run build task yarn build
Starts development mode with watch task
Run development task yarn dev