Skip to content

Instantly share code, notes, and snippets.

@linktohack
Last active May 4, 2023 14:32
Show Gist options
  • Save linktohack/c3159d2125d7cc379cba34bb2737a523 to your computer and use it in GitHub Desktop.
Save linktohack/c3159d2125d7cc379cba34bb2737a523 to your computer and use it in GitHub Desktop.
Generate ovpn from a list of IP, result from ipinfo.io
# remote-random
cat *.json | jq -s -r 'sort_by(.country) | .[] | "remote \(.ip) 1193 # \(.country)-\(.city)"'
# remote
cat *.json | jq -s -r "sort_by(.country) | .[] | \"cat ~/.config/default.ovpn | sed 's/remote XXX/remote \(.ip) 1193 # \(.country)-\(.city)/' > '\(.country)-\(.city)-\(.ip).ovpn'\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment