Merge pull request #15 from leafnsand/master

解决使用v2ray时候的status显示错误,解决v2ray使用ws模式的时候域名被解析成IP的bug
This commit is contained in:
Chaco Green
2019-02-24 10:10:02 +08:00
committed by GitHub
2 changed files with 13 additions and 5 deletions

View File

@@ -28,10 +28,12 @@ local ws="null"
local h2="null"
local tls="null"
IFIP=`echo $ss_server | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}|:"`
if [ -z "$IFIP" ]; then
ss_server_tmp=`nslookup $ss_server | sed 1,2d | grep -Eo "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | head -1`
[ -z "$ss_server_tmp" ] && logsh "$service" "v2ray服务器地址解析失败跳过解析" || ss_server="$ss_server_tmp"
if [ "$ss_network" != "ws" ]; then
IFIP=`echo $ss_server | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}|:"`
if [ -z "$IFIP" ]; then
ss_server_tmp=`nslookup $ss_server | sed 1,2d | grep -Eo "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | head -1`
[ -z "$ss_server_tmp" ] && logsh "$service" "v2ray服务器地址解析失败跳过解析" || ss_server="$ss_server_tmp"
fi
fi
get_ws_header() {

View File

@@ -701,7 +701,13 @@ status() {
#if [ "$result" == '0' ] || [ "$http_status" != "200" ]; then
result2=$(iptables -t nat -S | grep SHADOWSOCK)
[ "$ssgena" == '1' ] && ssgflag=", 游戏节点: $ssgid($ssg_mode)"
if [ "$result1" -ge 3 ]; then
process_count=3
if [ "$proxy_type" == "v2ray" ]; then
process_count=2
fi
if [ "$result1" -ge $process_count ]; then
if [ -n "$result2" ]; then
status="运行节点: $id($ss_mode)$ssgflag|1"
else