Fix get IP address backup method

This commit is contained in:
Teddysun 2015-01-13 17:02:06 +08:00
parent 819744a3b9
commit 99fed4ad51
4 changed files with 8 additions and 8 deletions

View File

@ -91,8 +91,8 @@ function pre_install(){
# Get IP address
echo "Getting Public IP address, Please wait a moment..."
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
if [ -z $IP ]; then
IP=`curl -s ifconfig.me/ip`
if [ $? -ne 0 -o -z $IP ]; then
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
fi
echo -e "Your main public IP is\t\033[32m$IP\033[0m"
echo ""

View File

@ -73,8 +73,8 @@ function pre_install(){
# Get IP address
echo "Getting Public IP address, Please wait a moment..."
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
if [ -z $IP ]; then
IP=`curl -s ifconfig.me/ip`
if [ $? -ne 0 -o -z $IP ]; then
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
fi
#Current folder
cur_dir=`pwd`

View File

@ -88,8 +88,8 @@ function pre_install(){
# Get IP address
echo "Getting Public IP address, Please wait a moment..."
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
if [ -z $IP ]; then
IP=`curl -s ifconfig.me/ip`
if [ $? -ne 0 -o -z $IP ]; then
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
fi
echo -e "Your main public IP is\t\033[32m$IP\033[0m"
echo ""

View File

@ -88,8 +88,8 @@ function pre_install(){
# Get IP address
echo "Getting Public IP address, Please wait a moment..."
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
if [ -z $IP ]; then
IP=`curl -s ifconfig.me/ip`
if [ $? -ne 0 -o -z $IP ]; then
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
fi
echo -e "Your main public IP is\t\033[32m$IP\033[0m"
echo ""