mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-11-23 21:46:08 +03:00
Bugfix: better IPv4 autodetection on some IPv6 enabled servers
This commit is contained in:
parent
4f631dab20
commit
ce8077f048
@ -24,11 +24,11 @@ fi
|
||||
# I do this to make the script compatible with NATed servers (lowendspirit.com)
|
||||
# and to avoid getting an IPv6.
|
||||
# Sorry for doing this, I didn't want to :(
|
||||
echo "$(grep address /etc/network/interfaces | grep -v 127.0.0.1 | awk '{print $2}')" | grep -q '.'
|
||||
echo "$(grep address /etc/network/interfaces | grep -v 127.0.0.1 | awk '{print $2}' | grep -q '.' | head -1)"
|
||||
if [ ! $? = 0 ]; then
|
||||
IP=$(wget -qO- ipv4.icanhazip.com)
|
||||
else
|
||||
IP=$(grep address /etc/network/interfaces | grep -v 127.0.0.1 | awk '{print $2}')
|
||||
IP=$(grep address /etc/network/interfaces | grep -v 127.0.0.1 | awk '{print $2}' | grep '.' | head -1)
|
||||
fi
|
||||
|
||||
# We will use this later
|
||||
|
Loading…
Reference in New Issue
Block a user