mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-11-27 15:36:07 +03:00
Variable check added to avoid performing the same request twice
This commit is contained in:
parent
730691c8a1
commit
22b5fdf80b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user