do not display regions where PF is blocked if PIA_PF=true

This commit is contained in:
gunix 2020-09-24 22:54:19 +03:00
parent 9a3d77ac4e
commit e9aa8545ca

View File

@ -76,9 +76,19 @@ fi
# Notify the user that we got the server list. # Notify the user that we got the server list.
echo "OK!" echo "OK!"
# Test one server from each region to get the closest region: # Test one server from each region to get the closest region
summarized_region_data="$( echo $all_region_data | # Only filter port forwarding enabled servers if specified
jq -r '.regions[] | .servers.meta[0].ip+" "+.id+" "+.name+" "+(.geo|tostring)' )" 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 \ echo Testing regions that respond \
faster than $MAX_LATENCY seconds: faster than $MAX_LATENCY seconds:
bestRegion="$(echo "$summarized_region_data" | bestRegion="$(echo "$summarized_region_data" |