Skip to content

Instantly share code, notes, and snippets.

Created December 3, 2017 05:55
Show Gist options
  • Save anonymous/947b2bb6b5ec075bb25a00f7df9d9088 to your computer and use it in GitHub Desktop.
Save anonymous/947b2bb6b5ec075bb25a00f7df9d9088 to your computer and use it in GitHub Desktop.
windscribe scan for decent server.
# Script that tries to find a windscribe vpn server with decent speeds
# Requires the windscribe command line client, and the speedtest.net
# python cli from here: https://github.com/sivel/speedtest-cli
#!/bin/bash
windscribe disconnect
speed=`speedtest --simple |grep -i download | cut -d ' ' -f 2`
echo "ISP Speed=$speed Mbps"
speed_cutoff=$(echo "$speed*0.85" | bc -l)
echo "Looking for servers faster than $speed_cutoff Mbps"
while true; do
windscribe connect
if [ "$?" -ne "0" ]; then
exit
fi
public_ip=`dig +short myip.opendns.com @resolver1.opendns.com`
# traceroute 8.8.8.8
speed=`speedtest --simple |grep -i download | cut -d ' ' -f 2`
echo "Speedtest=$speed Mbps, Server: $public_ip"
if (( $(echo "$speed > $speed_cutoff" |bc -l) )); then
exit
fi
windscribe disconnect
# traceroute $public_ip
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment