fix:重定向netstat错误信息
根据Issue #1的信息,v2ray.service和v2ray.tproxy脚本在执行时可能发生netstat的错误信息干扰判断.将netstat的错误信息重定向以避免干扰. Close #1
This commit is contained in:
@@ -50,7 +50,7 @@ wait_v2ray_listen() {
|
||||
wait_count=0
|
||||
v2ray_pid=`cat ${pid_file}`
|
||||
find_netstat_path && \
|
||||
check_v2ray_cmd="netstat -tnlp | grep v2ray | grep -q LISTEN" || \
|
||||
check_v2ray_cmd="netstat -tnlp 2>/dev/null | grep v2ray | grep -q LISTEN" || \
|
||||
check_v2ray_cmd="ls -lh /proc/${v2ray_pid}/fd | grep -q socket"
|
||||
while probe_v2ray_alive && ! eval "${check_v2ray_cmd}" && [ ${wait_count} -lt 100 ] ; do
|
||||
sleep 1 ; wait_count=$((${wait_count} + 1))
|
||||
|
@@ -46,7 +46,7 @@ find_netstat_path() {
|
||||
|
||||
probe_v2ray_listen() {
|
||||
find_netstat_path || return
|
||||
v2ray_listen=`netstat -tnlp | grep v2ray | grep LISTEN`
|
||||
v2ray_listen=`netstat -tnlp 2>/dev/null | grep v2ray | grep LISTEN`
|
||||
if eval "echo \"${v2ray_listen}\" | grep -q :::${proxy_port}" || eval "echo \"${v2ray_listen}\" | grep -q 0.0.0.0:${proxy_port}" || eval "echo \"${v2ray_listen}\" | grep -q '\[::\]:${proxy_port}'" ; then
|
||||
v2ray_share=true
|
||||
return
|
||||
|
Reference in New Issue
Block a user