Yep just tested the for loop sample i posted in VPNMON it wasn't detected as a valid command i had to reformat it all on a single line :You definitely have a gift, and what seems a much easier time developing these statements than I do!
I gave your "for i" loop sample a try, and while New York resulted in 3 returns, Alabama (as in @JTnola's case) only comes back with 1 result for me... I would have expected 5 for each... I wasn't sure if posix could handle a loop like that, so I changed it up... also added a sleep 1 in there, to see if that would cause the API to give me more IPs as well... so this statement consistently gives me 4 IPs:
Code:i=0; while [ $i -ne 5 ]; do i=$((i + 1)); curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://serverlist.piaservers.net/vpninfo/servers/v6 | jq --raw-output '.regions[] | select(.name=="US Alabama") | .servers.ovpnudp[].ip' 2>/dev/null; sleep 1; done | sort | uniq
Code:
for i in {1..5}; do curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://serverlist.piaservers.net/vpninfo/servers/v6 | jq --raw-output '.regions[] | select(.name=="US New York") | .servers.ovpnudp[].ip' 2>/dev/null; done | sort | uniq
What i noticed is that if i run the command manually in a Linux terminal I get more results.
----------------------------------------------------------------------------------------------------
Bash:
i=0; while [ $i -ne 5 ]; do i=$((i + 1)); curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://serverlist.piaservers.net/vpninfo/servers/v6 | jq --raw-output '.regions[] | select(.name=="US Alabama") | .servers.ovpnudp[].ip' 2>/dev/null; sleep 1; done | sort | uniq
Your command seems to get results more consistently with VPNMON List Automation.
Awesome job.
Edit:
Raising the sleep value will give you more results since there might be timer for when the ip's rotate.
With sleep 1 i got 4 rows with sleep 5 i got 6 rows.
Last edited: