Last active
March 3, 2026 20:17
-
-
Save eevmanu/01d6f31e9635bc9d4fd840f5ecb0e837 to your computer and use it in GitHub Desktop.
detect available iperf3 servers in miami , new york and los angeles to have a more precise test of upload and download bandwidth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| iperf3_us_cities() { | |
| local url='https://export.iperf3serverlist.net/listed_iperf3_servers.json' | |
| local sites='los angeles|miami|new york city' | |
| printf ' last-modified: ' | |
| curl -sI "$url" | grep -i '^last-modified:' | cut -d' ' -f2- | tr -d '\r' | |
| printf '\n' | |
| local result | |
| result=$(curl -s "$url" | jq -r --arg s "$sites" ' | |
| [ .[] | select(.SITE | ascii_downcase | test("^(" + $s + ")$")) ] | | |
| if length == 0 then | |
| "WARN: 0 matches for [\($s)] -- schema may have changed", | |
| " try: curl -s URL | jq \"[.[].SITE] | unique | sort\"" | |
| else .[] | | |
| (.["IP/HOST"] // null) as $host | | |
| if $host == null then | |
| "# SKIP: no IP/HOST for \(.SITE // "?") (\(.PROVIDER // "?"))" | |
| else | |
| (.PORT // "5201") as $fp | | |
| ($fp | split("-")[0]) as $p | | |
| (.OPTIONS // "" | split(",") | map(select(length>0)) | join(" ")) as $o | | |
| "iperf3 -c \($host) -p \($p)" + | |
| (if ($o | length) > 0 then " \($o)" else "" end) + | |
| " # \(.SITE) -- \(.PROVIDER // "?")" + | |
| (if ($fp | contains("-")) then " [range: \($fp)]" else "" end) | |
| end | |
| end | |
| ') || { echo "FAIL: curl or jq error -- inspect $url manually"; return 1; } | |
| if [ -z "$result" ]; then | |
| echo "FAIL: empty output -- check connectivity or JSON structure" | |
| return 1 | |
| fi | |
| echo "$result" | |
| } | |
| iperf3_us_cities |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a new tool i found recently is
https://radar.cloudflare.com/speedtest