Fix get IP address backup method
This commit is contained in:
parent
819744a3b9
commit
99fed4ad51
|
|
@ -91,8 +91,8 @@ function pre_install(){
|
||||||
# Get IP address
|
# Get IP address
|
||||||
echo "Getting Public IP address, Please wait a moment..."
|
echo "Getting Public IP address, Please wait a moment..."
|
||||||
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
|
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
|
||||||
if [ -z $IP ]; then
|
if [ $? -ne 0 -o -z $IP ]; then
|
||||||
IP=`curl -s ifconfig.me/ip`
|
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
|
||||||
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 ""
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,8 @@ function pre_install(){
|
||||||
# Get IP address
|
# Get IP address
|
||||||
echo "Getting Public IP address, Please wait a moment..."
|
echo "Getting Public IP address, Please wait a moment..."
|
||||||
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
|
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
|
||||||
if [ -z $IP ]; then
|
if [ $? -ne 0 -o -z $IP ]; then
|
||||||
IP=`curl -s ifconfig.me/ip`
|
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
|
||||||
fi
|
fi
|
||||||
#Current folder
|
#Current folder
|
||||||
cur_dir=`pwd`
|
cur_dir=`pwd`
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,8 @@ function pre_install(){
|
||||||
# Get IP address
|
# Get IP address
|
||||||
echo "Getting Public IP address, Please wait a moment..."
|
echo "Getting Public IP address, Please wait a moment..."
|
||||||
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
|
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
|
||||||
if [ -z $IP ]; then
|
if [ $? -ne 0 -o -z $IP ]; then
|
||||||
IP=`curl -s ifconfig.me/ip`
|
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
|
||||||
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 ""
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,8 @@ function pre_install(){
|
||||||
# Get IP address
|
# Get IP address
|
||||||
echo "Getting Public IP address, Please wait a moment..."
|
echo "Getting Public IP address, Please wait a moment..."
|
||||||
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
|
IP=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
|
||||||
if [ -z $IP ]; then
|
if [ $? -ne 0 -o -z $IP ]; then
|
||||||
IP=`curl -s ifconfig.me/ip`
|
IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'`
|
||||||
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 ""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user