mirror of
https://github.com/angristan/openvpn-install.git
synced 2024-11-22 08:49:03 +01: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)
|
# I do this to make the script compatible with NATed servers (lowendspirit.com)
|
||||||
# and to avoid getting an IPv6.
|
# and to avoid getting an IPv6.
|
||||||
# Sorry for doing this, I didn't want to :(
|
# 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
|
if [ ! $? = 0 ]; then
|
||||||
IP=$(wget -qO- ipv4.icanhazip.com)
|
IP=$(wget -qO- ipv4.icanhazip.com)
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
# We will use this later
|
# We will use this later
|
||||||
|
Loading…
Reference in New Issue
Block a user