2018-04-15 14:15:58 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2018-04-16 14:19:35 -04:00
|
|
|
printf "\nDetecting details from public IP address..."
|
|
|
|
|
export CITY=$(wget -qO- -T 2 https://ipinfo.io/city)
|
|
|
|
|
export ORG=$(wget -qO- -T 2 https://ipinfo.io/org)
|
2018-04-16 14:50:24 -04:00
|
|
|
printf "DONE\nOrganization: $ORG\nCity: $CITY\nChanging DNS to localhost..."
|
2018-04-15 14:15:58 -04:00
|
|
|
echo "nameserver 127.0.0.1" > /etc/resolv.conf
|
|
|
|
|
echo "options ndots:0" >> /etc/resolv.conf
|
2018-04-16 14:19:35 -04:00
|
|
|
printf "DONE\nStarting Unbound to connect to Cloudflare DNS 1.1.1.1 at its TLS endpoint..."
|
2018-04-15 14:15:58 -04:00
|
|
|
unbound
|
|
|
|
|
printf "DONE\nStarting OpenVPN using $PROTOCOL with $ENCRYPTION encryption\n"
|
2018-04-16 14:50:24 -04:00
|
|
|
cd /openvpn-$PROTOCOL-$ENCRYPTION
|
|
|
|
|
openvpn --config $REGION.ovpn --auth-user-pass /auth.conf
|
2018-04-15 14:15:58 -04:00
|
|
|
printf "\n\nExiting..."
|