13 lines
416 B
Bash
13 lines
416 B
Bash
|
#!/usr/bin/env bash
|
|||
|
# This gets the current wireguard relay list from mullvad’s API and transforms
|
|||
|
# it into a format that takes up less space than the original response.
|
|||
|
set -euo pipefail
|
|||
|
curl -s 'https://api.mullvad.net/www/relays/wireguard/' | jq '. | map({
|
|||
|
key: .hostname | split("-")[0],
|
|||
|
value: {
|
|||
|
endpoint4: .ipv4_addr_in,
|
|||
|
endpoint6: .ipv6_addr_in,
|
|||
|
pubkey: .pubkey
|
|||
|
}
|
|||
|
}) | from_entries' > relays.json
|