Fix get public IP problem

This commit is contained in:
Teddysun 2014-07-12 11:42:01 +09:00
parent 8968409593
commit 6d214d588d
4 changed files with 25 additions and 12 deletions

View File

@ -18,9 +18,6 @@ echo "#"
echo "#############################################################"
echo ""
# Get IP address(Default No.1)
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.*' | cut -d: -f2 | awk '{ print $1}' | head -1`;
# Install Shadowsocks-libev
function install_shadowsocks_libev(){
rootness
@ -70,7 +67,13 @@ function pre_install(){
echo "Press any key to start...or Press Ctrl+C to cancel"
char=`get_char`
#Install necessary dependencies
apt-get install -y wget unzip build-essential autoconf libtool libssl-dev
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=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
if [ -z $IP ]; then
IP=`curl -s ifconfig.me/ip`
fi
#Current folder
cur_dir=`pwd`
cd $cur_dir

View File

@ -18,9 +18,6 @@ echo "#"
echo "#############################################################"
echo ""
# Get IP address(Default No.1)
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.*' | cut -d: -f2 | awk '{ print $1}' | head -1`;
# Install Shadowsocks-libev
function install_shadowsocks_libev(){
rootness
@ -73,6 +70,12 @@ function pre_install(){
#Install necessary dependencies
yum install -y wget unzip openssl-devel gcc swig python python-devel python-setuptools autoconf libtool libevent
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=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
if [ -z $IP ]; then
IP=`curl -s ifconfig.me/ip`
fi
#Current folder
cur_dir=`pwd`
cd $cur_dir

View File

@ -18,8 +18,6 @@ echo "#"
echo "#############################################################"
echo ""
# Get IP address(Default No.1)
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.*' | cut -d: -f2 | awk '{ print $1}' | head -1`;
# Get Nodejs latest version
NODEJS_VER=`curl -s http://nodejs.org/download/ | awk -F'<b>' '/Current version/{print $2}' | cut -d '<' -f 1`
@ -75,6 +73,12 @@ function pre_install(){
#Install necessary dependencies
yum install -y wget unzip openssl-devel gcc swig python python-devel python-setuptools autoconf libtool libevent
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=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
if [ -z $IP ]; then
IP=`curl -s ifconfig.me/ip`
fi
#Current folder
cur_dir=`pwd`
cd $cur_dir

View File

@ -18,9 +18,6 @@ echo "#"
echo "#############################################################"
echo ""
# Get IP address
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.*' | cut -d: -f2 | awk '{ print $1}' | head -1`;
# Install Shadowsocks
function install_shadowsocks(){
rootness
@ -73,6 +70,12 @@ function pre_install(){
#Install necessary dependencies
yum install -y wget unzip openssl-devel gcc swig python python-devel python-setuptools autoconf libtool libevent
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=`curl -s checkip.dyndns.com | cut -d' ' -f 6 | cut -d'<' -f 1`
if [ -z $IP ]; then
IP=`curl -s ifconfig.me/ip`
fi
#Current folder
cur_dir=`pwd`
cd $cur_dir