networking fixes
Some checks failed
Check Flake / check-flake (push) Has been cancelled

This commit is contained in:
2026-02-25 00:08:27 -08:00
parent 12209b69b8
commit 0368661e24

View File

@@ -3,15 +3,15 @@ let
in in
# Bash function library for PIA VPN WireGuard operations. # Bash function library for PIA VPN WireGuard operations.
# All PIA API calls accept an optional $proxy variable: # All PIA API calls accept an optional $proxy variable:
# proxy="http://10.100.0.1:8888" fetchPIAToken # proxy="http://10.100.0.1:8888" fetchPIAToken
# When $proxy is set, curl uses --proxy "$proxy"; otherwise direct connection. # When $proxy is set, curl uses --proxy "$proxy"; otherwise direct connection.
# Reference materials: # Reference materials:
# https://serverlist.piaservers.net/vpninfo/servers/v6 # https://serverlist.piaservers.net/vpninfo/servers/v6
# https://github.com/pia-foss/manual-connections # https://github.com/pia-foss/manual-connections
# https://github.com/thrnz/docker-wireguard-pia/blob/master/extra/wg-gen.sh # https://github.com/thrnz/docker-wireguard-pia/blob/master/extra/wg-gen.sh
# https://www.wireguard.com/netns/#ordinary-containerization # https://www.wireguard.com/netns/#ordinary-containerization
{ {
scriptCommon = '' scriptCommon = ''
@@ -47,9 +47,6 @@ in
"https://serverlist.piaservers.net/vpninfo/servers/v6" > "$servers" "https://serverlist.piaservers.net/vpninfo/servers/v6" > "$servers"
head -n 1 "$servers" | tr -d '\n' > "$servers_json" head -n 1 "$servers" | tr -d '\n' > "$servers_json"
echo "Available location ids:"
jq '.regions | .[] | {name, id, port_forward}' "$servers_json"
totalservers=$(jq -r \ totalservers=$(jq -r \
'.regions | .[] | select(.id=="'"$serverLocation"'") | .servers.wg | length' \ '.regions | .[] | select(.id=="'"$serverLocation"'") | .servers.wg | length' \
"$servers_json") "$servers_json")