From dd26662fdf646d0f6750de602d43ef514e8e21bd Mon Sep 17 00:00:00 2001 From: Orazio Date: Fri, 12 Oct 2018 21:06:11 +0200 Subject: [PATCH] Update install.sh --- auto_install/install.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 3cb6310..f743d05 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -949,13 +949,11 @@ confNetwork() { } confOVPN() { - IPv4pub=$(dig +short myip.opendns.com @208.67.222.222) - if [ $? -ne 0 ] || [ -z "$IPv4pub" ]; then - echo "dig failed, now trying to curl whatismyip.akamai.com" - if ! IPv4pub=$(curl -s http://whatismyip.akamai.com) - then - echo "whatismyip.akamai.com failed, please check your internet connection/DNS" - exit $? + if ! IPv4pub=$(dig +short myip.opendns.com @208.67.222.222) || ! valid_ip "$IPv4pub"; then + echo "dig failed, now trying to curl checkip.amazonaws.com" + if ! IPv4pub=$(curl -s https://checkip.amazonaws.com) || ! valid_ip "$IPv4pub"; then + echo "checkip.amazonaws.com failed, please check your internet connection/DNS" + exit 1 fi fi $SUDO cp /tmp/pivpnUSR /etc/pivpn/INSTALL_USER