Skip to content

Commit

Permalink
# 添加了几个外网IP获取源,避免一些服务器无法获取外网IP
Browse files Browse the repository at this point in the history
  • Loading branch information
Toyo authored Aug 24, 2017
1 parent 3bcdb1a commit 8c3fa88
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
16 changes: 12 additions & 4 deletions ssr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export PATH
#=================================================
# System Required: CentOS 6+/Debian 6+/Ubuntu 14.04+
# Description: Install the ShadowsocksR server
# Version: 2.0.28
# Version: 2.0.29
# Author: Toyo
# Blog: https://doub.io/ss-jc42/
#=================================================

sh_ver="2.0.28"
sh_ver="2.0.29"
filepath=$(cd "$(dirname "$0")"; pwd)
file=$(echo -e "${filepath}"|awk -F "$0" '{print $1}')
ssr_folder="/usr/local/shadowsocksr"
Expand Down Expand Up @@ -109,8 +109,16 @@ Set_iptables(){
}
# 读取 配置信息
Get_IP(){
ip=`wget -qO- -t1 -T2 ipinfo.io/ip`
[[ -z "$ip" ]] && ip="VPS_IP"
ip=$(wget -qO- -t1 -T2 ipinfo.io/ip)
if [[ -z "${ip}" ]]; then
ip=$(wget -qO- -t1 -T2 api.ip.sb/ip)
if [[ -z "${ip}" ]]; then
ip=$(wget -qO- -t1 -T2 members.3322.org/dyndns/getip)
if [[ -z "${ip}" ]]; then
ip="VPS_IP"
fi
fi
fi
}
Get_User(){
[[ ! -e ${jq_file} ]] && echo -e "${Error} JQ解析器 不存在,请检查 !" && exit 1
Expand Down
14 changes: 11 additions & 3 deletions ssrmu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export PATH
#=================================================
# System Required: CentOS 6+/Debian 6+/Ubuntu 14.04+
# Description: Install the ShadowsocksR mudbjson server
# Version: 1.0.7
# Version: 1.0.8
# Author: Toyo
# Blog: https://doub.io/ss-jc60/
#=================================================

sh_ver="1.0.7"
sh_ver="1.0.8"
filepath=$(cd "$(dirname "$0")"; pwd)
file=$(echo -e "${filepath}"|awk -F "$0" '{print $1}')
ssr_folder="/usr/local/shadowsocksr"
Expand Down Expand Up @@ -117,7 +117,15 @@ Set_iptables(){
# 读取 配置信息
Get_IP(){
ip=$(wget -qO- -t1 -T2 ipinfo.io/ip)
[[ -z "$ip" ]] && ip="VPS_IP"
if [[ -z "${ip}" ]]; then
ip=$(wget -qO- -t1 -T2 api.ip.sb/ip)
if [[ -z "${ip}" ]]; then
ip=$(wget -qO- -t1 -T2 members.3322.org/dyndns/getip)
if [[ -z "${ip}" ]]; then
ip="VPS_IP"
fi
fi
fi
}
Get_User_info(){
Get_user_port=$1
Expand Down

0 comments on commit 8c3fa88

Please sign in to comment.