luci-app-ssr-plus: use wget-ssl if possible
Fixes: #921 Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
55c92f0952
commit
639b7d8fde
@ -76,7 +76,7 @@ get_host_ip() {
|
||||
if [ -z "$(echo $host | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}")" ]; then
|
||||
if [ "$host" == "${host#*:[0-9a-fA-F]}" ]; then
|
||||
ip=$(resolveip -4 -t 3 $host | awk 'NR==1{print}')
|
||||
[ -z "$ip" ] && ip=$(uclient-fetch -q -O- http://119.29.29.29/d?dn=$host | awk -F ';' '{print $1}')
|
||||
[ -z "$ip" ] && ip=$(wget -q -O- http://119.29.29.29/d?dn=$host | awk -F ';' '{print $1}')
|
||||
fi
|
||||
fi
|
||||
[ -z "$ip" ] || uci_set_by_name $1 ip $ip
|
||||
|
@ -436,7 +436,7 @@ local function processData(szType, content)
|
||||
end
|
||||
-- wget
|
||||
local function wget(url)
|
||||
local stdout = luci.sys.exec('uclient-fetch -q --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" --no-check-certificate -O- "' .. url .. '"')
|
||||
local stdout = luci.sys.exec('wget -q --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" --no-check-certificate -O- "' .. url .. '"')
|
||||
return trim(stdout)
|
||||
end
|
||||
|
||||
|
@ -101,7 +101,7 @@ end
|
||||
|
||||
local function update(url, file, type, file2)
|
||||
local Num = 1
|
||||
local refresh_cmd = "uclient-fetch --no-check-certificate -q -O /tmp/ssr-update." .. type .. " " .. url
|
||||
local refresh_cmd = "wget --no-check-certificate -q -O /tmp/ssr-update." .. type .. " " .. url
|
||||
local sret = luci.sys.call(refresh_cmd)
|
||||
if sret == 0 then
|
||||
if type == "gfw_data" then
|
||||
|
Loading…
Reference in New Issue
Block a user