ryanniehaus / useful_scripts

A repository for keeping useful utility scripts
MIT License
20 stars 16 forks source link

Add www.vpngate.net as a provider to the openvpn script #10

Open ryanniehaus opened 8 years ago

ryanniehaus commented 8 years ago

@famewolf made this comment in Issue #1 : "Oh I didn't mention them but strictly as an FYI there is also freevpnsoftware.net and http://www.vpngate.net/ both of which do not use username/password. The only problem with vpngate is that even when you find a handful that work the NEXT time you want to use them they are defunct. When you visit the website it pulls up a random amount of nodes for you to use."

This issue is meant to track adding www.vpngate.net as a provider. (Not sure this one is really plausible given the way it works)

famewolf commented 8 years ago

I found the following code for vpngate that works ok standalone to grab entries by country....

#!/bin/bash ###################################### MRP080425 - GetVPNgateConfig.sh v0.2b if [ "$1" = "" ] then echo "Usage: GetVPNgateConfig.sh " exit fi path="/home/famewolf/vpn/vpngate" wget -q http://www.vpngate.net/en/ -O - | grep "
$1" > ${path}'/vpngate.html' country=${1/" "/"_"} if ls ${path}/${country}_VPNgate\* 1> /dev/null 2>&1; then rm ${path}/${country}_VPNgate\* ; fi counter=1 while read line do line=${line/_openvpn/'http':'//www.vpngate.net/common/openvpn_download'} line=${line/\'>_} case "$line" in _udp=[1-9]_) line=${line/udp=/port=} line=${line/&tcp=_port=/&port=} line=$line'&udp=1 -O '$path/${country}'_VPNgate'${counter}'.ovpn' ;; *tcp=[1-9]_) line=${line/tcp=/port=} line=${line/&udp=*sid=/&sid=} line=$line'&tcp=1 -O '$path/${country}'_VPNgate'${counter}'.ovpn' ;; *) continue esac line=${line/fqdn/host} wget -q $line > /dev/null if [ $? -ne 0 ]; then continue; fi counter=$((counter+1)) done < ${path}'/vpngate.html' rm ${path}/vpngate.html