From 7f3b70dbade54aa35070ee9fadd217a369ea3a42 Mon Sep 17 00:00:00 2001 From: leafnsand Date: Thu, 21 Feb 2019 12:03:02 +0800 Subject: [PATCH] fixed status error of v2ray, remain domain while using ws mode of v2ray --- apps/shadowsocks/scripts/general_v2ray_config.sh | 10 ++++++---- apps/shadowsocks/scripts/shadowsocks.sh | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/shadowsocks/scripts/general_v2ray_config.sh b/apps/shadowsocks/scripts/general_v2ray_config.sh index 842e59d..1e58d71 100644 --- a/apps/shadowsocks/scripts/general_v2ray_config.sh +++ b/apps/shadowsocks/scripts/general_v2ray_config.sh @@ -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() { diff --git a/apps/shadowsocks/scripts/shadowsocks.sh b/apps/shadowsocks/scripts/shadowsocks.sh index f3a8adf..96c84be 100644 --- a/apps/shadowsocks/scripts/shadowsocks.sh +++ b/apps/shadowsocks/scripts/shadowsocks.sh @@ -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