diff --git a/connect_to_wireguard_with_token.sh b/connect_to_wireguard_with_token.sh index a282a3f..78f0905 100755 --- a/connect_to_wireguard_with_token.sh +++ b/connect_to_wireguard_with_token.sh @@ -51,7 +51,7 @@ if [[ ! $WG_SERVER_IP || ! $WG_HOSTNAME || ! $WG_TOKEN ]]; then echo as it will guide you through getting the best server and echo also a token. Detailed information can be found here: echo https://github.com/pia-foss/manual-connections -exit 1 + exit 1 fi # Create ephemeral wireguard keys, that we don't need to save to disk. @@ -128,7 +128,7 @@ fi echo " This script got started with PIA_PF=true. Starting procedure to enable port forwarding by running the following command: -PIA_TOKEN=$WG_TOKEN \\ +$ PIA_TOKEN=$WG_TOKEN \\ PF_GATEWAY=\"$(echo "$wireguard_json" | jq -r '.server_vip')\" \\ PF_HOSTNAME=\"$WG_HOSTNAME\" \\ ./port_forwarding.sh diff --git a/get_region_and_token.sh b/get_region_and_token.sh index 9822275..4bdc18c 100755 --- a/get_region_and_token.sh +++ b/get_region_and_token.sh @@ -157,7 +157,7 @@ echo "The ./get_region_and_token.sh script got started with PIA_AUTOCONNECT=wire so we will automatically connect to WireGuard, by running this command: $ WG_TOKEN=\"$token\" \\ WG_SERVER_IP=$bestServer_WG_IP WG_HOSTNAME=$bestServer_WG_hostname \\ - PIA_PF=$PIA_PF ./wireguard_port_forwarding.sh + PIA_PF=$PIA_PF ./connect_to_wireguard_with_token.sh " PIA_PF=$PIA_PF WG_TOKEN="$token" WG_SERVER_IP=$bestServer_WG_IP \ diff --git a/port_forwarding.sh b/port_forwarding.sh index 04b068f..32ffe32 100755 --- a/port_forwarding.sh +++ b/port_forwarding.sh @@ -59,7 +59,7 @@ if [[ ! $PAYLOAD_AND_SIGNATURE ]]; then payload_and_signature="$(curl -s -m 5 \ --connect-to "$PF_HOSTNAME::$PF_GATEWAY:" \ --cacert "ca.rsa.4096.crt" \ - -G --data-urlencode "token=${WG_TOKEN}" \ + -G --data-urlencode "token=${PIA_TOKEN}" \ "https://${PF_HOSTNAME}:19999/getSignature")" else payload_and_signature="$PAYLOAD_AND_SIGNATURE"