This simple Bash script connects to NordVPN using a random country from a predefined list.
-
Clone the repository to your local machine:
git clone https://github.com/GiorgosIlia/nordvpn-random-country.git
-
Navigate to the project directory:
cd nordvpn-random-country
-
Make the script executable:
chmod +x nordvpn_connect.sh
-
Run the script:
./nordvpn_connect.sh
- United Kingdom
- Germany
- Netherlands
- France
- Sweden
- Switzerland
- Belgium
- Denmark
- Norway
- Poland
- Ireland
- Czech Republic
- Italy
- Spain
- Finland
- Serbia
- Austria
- Slovakia
- Slovenia
- Bulgaria
- Hungary
- Latvia
- Romania
- Portugal
- Luxembourg
- Ukraine
- Greece
- Estonia
- Iceland
- Albania
- Cyprus
- Croatia
- Moldova
- Bosnia and Herzegovina
- Georgia
- North Macedonia
- Lithuania
- This script relies on the NordVPN CLI tool being installed and configured on your system.
- It randomly selects a country from the list and connects to NordVPN using that country as the server location.
Feel free to customize the list of countries or script behavior as needed.
To run the script periodically, you can set up a cron job. For example, to run the script every 4 hours, follow these steps:
-
Open your crontab configuration:
crontab -e
-
Add a new cron job that specifies the frequency and the script to run. To run the script every 4 hours, you can use the following format:
0 */4 * * * /path/to/nordvpn-random-country/nordvpn_connect.sh
Replace
/path/to/nordvpn-random-country/
with the actual path to the script. Save and exit the crontab editor.
The script will now execute automatically every 4 hours. You can customize the schedule by adjusting the cron expression to your desired frequency.
This script is open-source and available under the MIT License.