1
0
Fork 0
mirror of https://github.com/Nyr/openvpn-install.git synced 2025-04-05 05:33:30 +03:00
This commit is contained in:
Rubén Díaz 2013-07-31 14:39:15 -07:00
commit 481c0339ab

View file

@ -26,6 +26,7 @@ fi
IP=$(ifconfig | grep 'inet addr:' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d: -f2 | awk '{ print $1}')
if [ "$IP" = "" ]; then
IP=$(wget -qO- ipv4.icanhazip.com)
EXTERNALIP=$IP
fi
@ -179,7 +180,7 @@ else
mkdir ~/ovpn-$CLIENT
# Try to detect a NATed connection and ask about it to potential LowEndSpirit
# users
EXTERNALIP=$(wget -qO- ipv4.icanhazip.com)
if [ -z "$EXTERNALIP" ]; then EXTERNALIP=$(wget -qO- ipv4.icanhazip.com); fi
if [ "$IP" != "$EXTERNALIP" ]; then
echo ""
echo "Looks like your server is behind a NAT!"
@ -209,4 +210,4 @@ else
echo ""
echo "Your client config is available at ~/ovpn-$CLIENT.tar.gz"
echo "If you want to add more clients, you simply need to run this script another time!"
fi
fi