From 53d2da47e37d0e56fea9bd3226e411d347bc7ea9 Mon Sep 17 00:00:00 2001 From: gunix Date: Sun, 20 Sep 2020 01:39:14 +0300 Subject: [PATCH] changed documentation and comments to make it easier to read through --- README.md | 9 ++++----- get_region_and_token.sh | 12 +++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5c44f38..5b9508d 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,10 @@ The functionality of the scripts within this repository has been tested and conf ### Disclaimers -These scripts do not touch IPv6 or DNS in order to give you the freedom of configuring your setup the way you desire it to work. This means you should have good understanding of VPN and cybersecurity in order to properly configure your setup. - -The scripts are also really fresh at this moment, so please take into consideration the fact that you will probably be one of the first users that use the scripts. The scripts work only on the NextGen network. - -For battle-tested security, please use the official PIA App, as it was designed to protect you in all scenarios. + * Port Forwarding is disabled on server-side in the United States. + * These scripts do not touch IPv6 or DNS, so that you have the freedom to configure your setup the way you desire it to work. This means you should have good understanding of VPN and cybersecurity in order to properly configure your setup. + * For battle-tested security, please use the official PIA App, as it was designed to protect you in all scenarios. + * This repo is really fresh at this moment, so please take into consideration the fact that you will probably be one of the first users that use the scripts. ## PIA Port Forwarding diff --git a/get_region_and_token.sh b/get_region_and_token.sh index 4bdc18c..0f3b1b0 100755 --- a/get_region_and_token.sh +++ b/get_region_and_token.sh @@ -63,13 +63,11 @@ fi echo "OK!" # Test one server from each region to get the closest region: +summarized_region_data="$( echo $all_region_data | + jq -r '.regions[] | .servers.meta[0].ip+" "+.id+" "+.name+" "+(.geo|tostring)' )" echo Testing regions that respond \ faster than $maximum_allowed_latency seconds: -region_latency_report="$( echo $all_region_data | - jq -r '.regions[] | .servers.meta[0].ip+" "+.id+" "+.name+" "+(.geo|tostring)' )" - -# Get the best region -bestRegion="$(echo "$region_latency_report" | +bestRegion="$(echo "$summarized_region_data" | xargs -i bash -c 'printServerLatency {}' | sort | head -1 | awk '{ print $2 }')" @@ -143,8 +141,8 @@ if [ "$PIA_AUTOCONNECT" != wireguard ]; then echo $ PIA_USER=p0123456 PIA_PASS=xxx \ PIA_AUTOCONNECT=true PIA_PF=true ./sort_regions_by_latency.sh echo - echo You can also connect manually by running: - echo WG_TOKEN=\"$token\" WG_SERVER_IP=$bestServer_WG_IP \ + echo You can also connect now by running this command: + echo $ WG_TOKEN=\"$token\" WG_SERVER_IP=$bestServer_WG_IP \ WG_HOSTNAME=$bestServer_WG_hostname ./connect_to_wireguard_with_token.sh exit fi