Skip to content

Commit

Permalink
do not display regions where PF is blocked if PIA_PF=true
Browse files Browse the repository at this point in the history
  • Loading branch information
g00nix committed Sep 24, 2020
1 parent 9a3d77a commit e9aa854
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions get_region_and_token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,19 @@ fi
# Notify the user that we got the server list.
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)' )"
# Test one server from each region to get the closest region
# Only filter port forwarding enabled servers if specified
if [[ $PIA_PF == "true" ]]; then
echo Port Forwarding is enabled, so regions that do not support
echo port forwarding will get filtered out.
summarized_region_data="$( echo $all_region_data |
jq -r '.regions[] | select(.port_forward==true) |
.servers.meta[0].ip+" "+.id+" "+.name+" "+(.geo|tostring)' )"
else
summarized_region_data="$( echo $all_region_data |
jq -r '.regions[] |
.servers.meta[0].ip+" "+.id+" "+.name+" "+(.geo|tostring)' )"
fi
echo Testing regions that respond \
faster than $MAX_LATENCY seconds:
bestRegion="$(echo "$summarized_region_data" |
Expand Down

0 comments on commit e9aa854

Please sign in to comment.