diff --git a/openvpn-install.sh b/openvpn-install.sh index b696b76..1afee19 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -21,7 +21,7 @@ fi # Try to get our IP from the system and fallback to the Internet. # I do this to make the script compatible with NATed servers (lowendspirit.com) # and to avoid getting an IPv6. -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}') +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}' | head -1) if [ "$IP" = "" ]; then IP=$(wget -qO- ipv4.icanhazip.com) fi