From 42abc7b5170193a654a7bc92a4f46917564e860f Mon Sep 17 00:00:00 2001 From: Teddysun Date: Wed, 18 Nov 2015 15:13:00 +0800 Subject: [PATCH] Simply get IP address --- shadowsocks-go.sh | 2 +- shadowsocks-libev-debian.sh | 2 +- shadowsocks-libev.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shadowsocks-go.sh b/shadowsocks-go.sh index 32e5a72..91038de 100644 --- a/shadowsocks-go.sh +++ b/shadowsocks-go.sh @@ -135,7 +135,7 @@ function pre_install(){ echo "Getting Public IP address, Please wait a moment..." IP=$(curl -s -4 icanhazip.com) if [[ "$IP" = "" ]]; then - IP=$(curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}') + IP=$(curl -s -4 ipinfo.io/ip) fi echo -e "Your main public IP is\t\033[32m$IP\033[0m" echo "" diff --git a/shadowsocks-libev-debian.sh b/shadowsocks-libev-debian.sh index bf81d7d..634c2be 100644 --- a/shadowsocks-libev-debian.sh +++ b/shadowsocks-libev-debian.sh @@ -98,7 +98,7 @@ function pre_install(){ echo "Getting Public IP address, Please wait a moment..." IP=$(curl -s -4 icanhazip.com) if [[ "$IP" = "" ]]; then - IP=$(curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}') + IP=$(curl -s -4 ipinfo.io/ip) fi echo -e "Your main public IP is\t\033[32m$IP\033[0m" echo "" diff --git a/shadowsocks-libev.sh b/shadowsocks-libev.sh index 247cb14..7b958d0 100644 --- a/shadowsocks-libev.sh +++ b/shadowsocks-libev.sh @@ -112,7 +112,7 @@ function pre_install(){ echo "Getting Public IP address, Please wait a moment..." IP=$(curl -s -4 icanhazip.com) if [[ "$IP" = "" ]]; then - IP=`curl -s -4 ipinfo.io | grep "ip" | awk -F\" '{print $4}'` + IP=`curl -s -4 ipinfo.io/ip` fi echo -e "Your main public IP is\t\033[32m$IP\033[0m" echo ""