feat: create wireguard.sh

Added as a convenience for people on Linux/Mac
This commit is contained in:
Edward Kerckhof 2024-12-29 17:50:13 +01:00 committed by GitHub
parent cc58e22b19
commit 7ae7af793c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#!/bin/bash
# Replace with your NordVPN access token
TOKEN="my-token-from-nordvpn"
# Encode credentials
ENCODED_CREDENTIALS=$(echo -n "token:$TOKEN" | base64)
# Set API URL
URL="https://api.nordvpn.com/v1/users/services/credentials"
# Make the API request and parse the result
response=$(curl -s -H "Authorization: Basic $ENCODED_CREDENTIALS" -X GET "$URL")
# Print the response (you can format it as needed)
echo "Response from NordVPN API:"
echo "$response"
# Optionally, parse specific fields (uncomment if needed)
# USERNAME=$(echo "$response" | jq -r '.username')
# PASSWORD=$(echo "$response" | jq -r '.password')
# NORDLYNX_PRIVATE_KEY=$(echo "$response" | jq -r '.nordlynx_private_key')
# echo "Username: $USERNAME"
# echo "Password: $PASSWORD"
# echo "NordLynx Private Key: $NORDLYNX_PRIVATE_KEY"