Update get public IP address method

This commit is contained in:
Teddysun 2015-03-24 17:14:46 +08:00
parent 44d7df50e3
commit 704d8d4f96
4 changed files with 4 additions and 4 deletions

View File

@ -110,7 +110,7 @@ function pre_install(){
fi
# Get IP address
echo "Getting Public IP address, Please wait a moment..."
IP=$(wget -qO- ipv4.icanhazip.com)
IP=$(curl -4 icanhazip.com)
if [[ "$IP" = "" ]]; then
IP=$(curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}')
fi

View File

@ -73,7 +73,7 @@ function pre_install(){
apt-get install -y wget unzip curl build-essential autoconf libtool libssl-dev
# Get IP address
echo "Getting Public IP address, Please wait a moment..."
IP=$(wget -qO- ipv4.icanhazip.com)
IP=$(curl -4 icanhazip.com)
if [[ "$IP" = "" ]]; then
IP=$(curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}')
fi

View File

@ -87,7 +87,7 @@ function pre_install(){
yum install -y automake make curl curl-devel zlib-devel openssl-devel perl perl-devel cpio expat-devel gettext-devel
# Get IP address
echo "Getting Public IP address, Please wait a moment..."
IP=$(wget -qO- ipv4.icanhazip.com)
IP=$(curl -4 icanhazip.com)
if [[ "$IP" = "" ]]; then
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
fi

View File

@ -107,7 +107,7 @@ function pre_install(){
fi
# Get IP address
echo "Getting Public IP address, Please wait a moment..."
IP=$(wget -qO- ipv4.icanhazip.com)
IP=$(curl -4 icanhazip.com)
if [[ "$IP" = "" ]]; then
IP=$(curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}')
fi