parent
9e8be6ad55
commit
897fe1da14
@ -286,7 +286,8 @@ function connect_status()
|
||||
local chn_list = uci:get(appname, "@global[0]", "chn_list") or "direct"
|
||||
local gfw_list = uci:get(appname, "@global[0]", "use_gfw_list") or "1"
|
||||
local proxy_mode = uci:get(appname, "@global[0]", "tcp_proxy_mode") or "proxy"
|
||||
local socks_server = api.get_cache_var("GLOBAL_TCP_SOCKS_server")
|
||||
local localhost_proxy = uci:get(appname, "@global[0]", "localhost_proxy") or "1"
|
||||
local socks_server = (localhost_proxy == "0") and api.get_cache_var("GLOBAL_TCP_SOCKS_server") or ""
|
||||
|
||||
-- 兼容 curl 8.6 time_starttransfer 错误
|
||||
local curl_ver = api.get_bin_version_cache("/usr/bin/curl", "-V 2>/dev/null | head -n 1 | awk '{print $2}' | cut -d. -f1,2 | tr -d ' \n'") or "0"
|
||||
@ -302,7 +303,7 @@ function connect_status()
|
||||
url = "-x socks5h://" .. socks_server .. " " .. url
|
||||
end
|
||||
end
|
||||
local result = luci.sys.exec('/usr/bin/curl --connect-timeout 3 -o /dev/null -I -sk ' .. url)
|
||||
local result = luci.sys.exec('/usr/bin/curl --max-time 5 -o /dev/null -I -sk ' .. url)
|
||||
local code = tonumber(luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $1}'") or "0")
|
||||
if code ~= 0 then
|
||||
local use_time = luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $2}'")
|
||||
|
@ -93,7 +93,7 @@ url_test_node() {
|
||||
local chn_list=$(config_n_get @global[0] chn_list direct)
|
||||
local probeUrl="www.google.com/generate_204"
|
||||
[ "${chn_list}" = "proxy" ] && probeUrl="www.baidu.com"
|
||||
result=$(${_curl} --connect-timeout 3 -o /dev/null -I -skL -x ${curlx} ${curl_arg}${probeUrl})
|
||||
result=$(${_curl} --max-time 5 -o /dev/null -I -skL -x ${curlx} ${curl_arg}${probeUrl})
|
||||
pgrep -af "url_test_${node_id}" | awk '! /test\.sh/{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||
rm -rf "/tmp/etc/${CONFIG}/url_test_${node_id}.json"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user