Simply get IP address

This commit is contained in:
Teddysun 2015-11-18 15:13:00 +08:00
parent b7ac746162
commit 42abc7b517
3 changed files with 3 additions and 3 deletions

View File

@ -135,7 +135,7 @@ function pre_install(){
echo "Getting Public IP address, Please wait a moment..." echo "Getting Public IP address, Please wait a moment..."
IP=$(curl -s -4 icanhazip.com) IP=$(curl -s -4 icanhazip.com)
if [[ "$IP" = "" ]]; then if [[ "$IP" = "" ]]; then
IP=$(curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}') IP=$(curl -s -4 ipinfo.io/ip)
fi fi
echo -e "Your main public IP is\t\033[32m$IP\033[0m" echo -e "Your main public IP is\t\033[32m$IP\033[0m"
echo "" echo ""

View File

@ -98,7 +98,7 @@ function pre_install(){
echo "Getting Public IP address, Please wait a moment..." echo "Getting Public IP address, Please wait a moment..."
IP=$(curl -s -4 icanhazip.com) IP=$(curl -s -4 icanhazip.com)
if [[ "$IP" = "" ]]; then if [[ "$IP" = "" ]]; then
IP=$(curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}') IP=$(curl -s -4 ipinfo.io/ip)
fi fi
echo -e "Your main public IP is\t\033[32m$IP\033[0m" echo -e "Your main public IP is\t\033[32m$IP\033[0m"
echo "" echo ""

View File

@ -112,7 +112,7 @@ function pre_install(){
echo "Getting Public IP address, Please wait a moment..." echo "Getting Public IP address, Please wait a moment..."
IP=$(curl -s -4 icanhazip.com) IP=$(curl -s -4 icanhazip.com)
if [[ "$IP" = "" ]]; then if [[ "$IP" = "" ]]; then
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'` IP=`curl -s -4 ipinfo.io/ip`
fi fi
echo -e "Your main public IP is\t\033[32m$IP\033[0m" echo -e "Your main public IP is\t\033[32m$IP\033[0m"
echo "" echo ""