luci-app-ssr-plus:Add gfwlist update URL (#3965)
This commit is contained in:
parent
9cbca25d79
commit
5b7fec3ab6
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-ssr-plus
|
||||
PKG_VERSION:=173
|
||||
PKG_RELEASE:=6
|
||||
PKG_RELEASE:=7
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
@ -68,9 +68,6 @@ define Package/$(PKG_NAME)/conffiles
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DATA) ./root/etc/china_ssr.txt $(1)/etc/china_ssr.txt
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./root/etc/config/shadowsocksr $(1)/etc/config/shadowsocksr
|
||||
$(INSTALL_DATA) ./root/etc/config/*.list $(1)/etc/config/
|
||||
|
@ -9,7 +9,7 @@ function index()
|
||||
end
|
||||
entry({"admin", "services", "shadowsocksr"}, alias("admin", "services", "shadowsocksr", "client"),_("ShadowSocksR Plus+"), 10).dependent = true
|
||||
entry({"admin", "services", "shadowsocksr", "client"}, cbi("shadowsocksr/client"),_("SSR Client"), 10).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr", "servers"}, arcombine(cbi("shadowsocksr/servers", {autoapply=true}), cbi("shadowsocksr/client-config")),_("Severs Nodes"), 20).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr", "servers"}, arcombine(cbi("shadowsocksr/servers", {autoapply = true}), cbi("shadowsocksr/client-config")),_("Severs Nodes"), 20).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr", "control"},cbi("shadowsocksr/control"), _("Access Control"), 30).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr", "advanced"},cbi("shadowsocksr/advanced"),_("Advanced Settings"), 50).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr", "server"},arcombine(cbi("shadowsocksr/server"), cbi("shadowsocksr/server-config")),_("SSR Server"), 60).leaf = true
|
||||
@ -19,19 +19,19 @@ function index()
|
||||
entry({"admin", "services", "shadowsocksr", "subscribe"}, call("subscribe"))
|
||||
entry({"admin", "services", "shadowsocksr", "checkport"}, call("check_port"))
|
||||
entry({"admin", "services", "shadowsocksr", "log"},form("shadowsocksr/log"),_("Log"), 80).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr","run"},call("act_status")).leaf=true
|
||||
entry({"admin", "services", "shadowsocksr", "ping"}, call("act_ping")).leaf=true
|
||||
entry({"admin", "services", "shadowsocksr","run"},call("act_status")).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr", "ping"}, call("act_ping")).leaf = true
|
||||
end
|
||||
|
||||
function subscribe()
|
||||
luci.sys.call("/usr/bin/lua /usr/share/shadowsocksr/subscribe.lua >> /tmp/ssrplus.log 2>&1")
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ ret = 1 })
|
||||
luci.http.write_json({ret = 1})
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("busybox ps -w | grep ssr-retcp | grep -v grep >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("busybox ps -w | grep ssr-retcp | grep -v grep >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@ -62,136 +62,138 @@ function check_status()
|
||||
local set = "/usr/bin/ssr-check www." .. luci.http.formvalue("set") .. ".com 80 3 1"
|
||||
sret = luci.sys.call(set)
|
||||
if sret == 0 then
|
||||
retstring ="0"
|
||||
retstring = "0"
|
||||
else
|
||||
retstring ="1"
|
||||
retstring = "1"
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ ret=retstring })
|
||||
luci.http.write_json({ret = retstring})
|
||||
end
|
||||
|
||||
function refresh_data()
|
||||
local set =luci.http.formvalue("set")
|
||||
local uci=luci.model.uci.cursor()
|
||||
local icount =0
|
||||
local set = luci.http.formvalue("set")
|
||||
local uci = luci.model.uci.cursor()
|
||||
local icount = 0
|
||||
if set == "gfw_data" then
|
||||
refresh_cmd="wget-ssl --no-check-certificate -O - https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt > /tmp/gfw.b64"
|
||||
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
refresh_cmd = "wget-ssl --no-check-certificate -O- " .. uci:get_first('shadowsocksr', 'global', 'gfwlist_url', 'https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt') .. ' > /tmp/gfw.b64'
|
||||
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret == 0 then
|
||||
luci.sys.call("/usr/bin/ssr-gfw")
|
||||
icount=luci.sys.exec("cat /tmp/gfwnew.txt | wc -l")
|
||||
icount = luci.sys.exec("cat /tmp/gfwnew.txt | wc -l")
|
||||
if tonumber(icount) > 1000 then
|
||||
oldcount= luci.sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l")
|
||||
oldcount = luci.sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l")
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("cp -f /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf")
|
||||
luci.sys.exec("cp -f /tmp/gfwnew.txt /tmp/dnsmasq.ssr/gfw_list.conf")
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart")
|
||||
retstring=tostring(tonumber(icount)/2)
|
||||
retstring = tostring(tonumber(icount)/2)
|
||||
else
|
||||
retstring ="0"
|
||||
retstring = "0"
|
||||
end
|
||||
else
|
||||
retstring="-1"
|
||||
retstring = "-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/gfwnew.txt")
|
||||
else
|
||||
retstring="-1"
|
||||
retstring = "-1"
|
||||
end
|
||||
elseif set == "ip_data" then
|
||||
refresh_cmd="wget-ssl --no-check-certificate -O - " .. uci:get_first('shadowsocksr', 'global', 'chnroute_url', 'https://ispip.clang.cn/all_cn.txt') .. ' > /tmp/china_ssr.txt'
|
||||
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
icount=luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
|
||||
end
|
||||
if set == "ip_data" then
|
||||
refresh_cmd = "wget-ssl --no-check-certificate -O- " .. uci:get_first('shadowsocksr', 'global', 'chnroute_url', 'https://ispip.clang.cn/all_cn.txt') .. ' > /tmp/china_ssr.txt'
|
||||
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
icount = luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
|
||||
if sret == 0 and tonumber(icount) > 1000 then
|
||||
oldcount=luci.sys.exec("cat /etc/china_ssr.txt | wc -l")
|
||||
oldcount = luci.sys.exec("cat /etc/china_ssr.txt | wc -l")
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("cp -f /tmp/china_ssr.txt /etc/china_ssr.txt")
|
||||
luci.sys.exec("/etc/init.d/shadowsocksr restart &")
|
||||
retstring=tostring(tonumber(icount))
|
||||
retstring = tostring(tonumber(icount))
|
||||
else
|
||||
retstring="0"
|
||||
retstring = "0"
|
||||
end
|
||||
else
|
||||
retstring="-1"
|
||||
retstring = "-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/china_ssr.txt")
|
||||
elseif set == "nfip_data" then
|
||||
refresh_cmd="wget-ssl --no-check-certificate -O - ".. uci:get_first('shadowsocksr', 'global', 'nfip_url','https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/NF_only.txt') .." > /tmp/netflixip.list"
|
||||
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
icount=luci.sys.exec("cat /tmp/netflixip.list | wc -l")
|
||||
end
|
||||
if set == "nfip_data" then
|
||||
refresh_cmd = "wget-ssl --no-check-certificate -O- ".. uci:get_first('shadowsocksr', 'global', 'nfip_url','https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/NF_only.txt') .." > /tmp/netflixip.list"
|
||||
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
icount = luci.sys.exec("cat /tmp/netflixip.list | wc -l")
|
||||
if sret == 0 and tonumber(icount) > 5 then
|
||||
oldcount=luci.sys.exec("cat /etc/config/netflixip.list | wc -l")
|
||||
oldcount = luci.sys.exec("cat /etc/config/netflixip.list | wc -l")
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("cp -f /tmp/netflixip.list /etc/config/netflixip.list")
|
||||
luci.sys.exec("/etc/init.d/shadowsocksr restart &")
|
||||
retstring=tostring(tonumber(icount))
|
||||
retstring = tostring(tonumber(icount))
|
||||
else
|
||||
retstring="0"
|
||||
retstring = "0"
|
||||
end
|
||||
else
|
||||
retstring="-1"
|
||||
retstring = "-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/netflixip.list")
|
||||
else
|
||||
refresh_cmd="wget-ssl --no-check-certificate -O - ".. uci:get_first('shadowsocksr', 'global', 'adblock_url','https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt') .." > /tmp/adnew.conf"
|
||||
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret== 0 then
|
||||
end
|
||||
if set == "ad_data" then
|
||||
refresh_cmd = "wget-ssl --no-check-certificate -O- ".. uci:get_first('shadowsocksr', 'global', 'adblock_url','https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt') .." > /tmp/adnew.conf"
|
||||
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret == 0 then
|
||||
luci.sys.call("/usr/bin/ssr-ad")
|
||||
icount=luci.sys.exec("cat /tmp/ad.conf | wc -l")
|
||||
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
|
||||
if tonumber(icount) > 100 then
|
||||
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
|
||||
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l")
|
||||
oldcount = luci.sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l")
|
||||
else
|
||||
oldcount="0"
|
||||
oldcount = "0"
|
||||
end
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf")
|
||||
luci.sys.exec("cp -f /tmp/ad.conf /tmp/dnsmasq.ssr/ad.conf")
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart")
|
||||
retstring=tostring(tonumber(icount))
|
||||
retstring = tostring(tonumber(icount))
|
||||
else
|
||||
retstring="0"
|
||||
retstring = "0"
|
||||
end
|
||||
else
|
||||
retstring="-1"
|
||||
retstring = "-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/ad.conf")
|
||||
else
|
||||
retstring="-1"
|
||||
retstring = "-1"
|
||||
end
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ret=retstring,retcount=icount})
|
||||
luci.http.write_json({ret = retstring,retcount = icount})
|
||||
end
|
||||
|
||||
function check_port()
|
||||
local set=""
|
||||
local retstring="<br /><br />"
|
||||
local set = ""
|
||||
local retstring = "<br /><br />"
|
||||
local s
|
||||
local server_name=""
|
||||
local shadowsocksr="shadowsocksr"
|
||||
local uci=luci.model.uci.cursor()
|
||||
local iret=1
|
||||
uci:foreach(shadowsocksr, "servers", function(s)
|
||||
local server_name = ""
|
||||
local uci = luci.model.uci.cursor()
|
||||
local iret = 1
|
||||
uci:foreach("shadowsocksr", "servers", function(s)
|
||||
if s.alias then
|
||||
server_name=s.alias
|
||||
server_name = s.alias
|
||||
elseif s.server and s.server_port then
|
||||
server_name="%s:%s" %{s.server, s.server_port}
|
||||
server_name = "%s:%s" %{s.server, s.server_port}
|
||||
end
|
||||
iret=luci.sys.call(" ipset add ss_spec_wan_ac " .. s.server .. " 2>/dev/null")
|
||||
socket=nixio.socket("inet", "stream")
|
||||
iret = luci.sys.call("ipset add ss_spec_wan_ac " .. s.server .. " 2>/dev/null")
|
||||
socket = nixio.socket("inet", "stream")
|
||||
socket:setopt("socket", "rcvtimeo", 3)
|
||||
socket:setopt("socket", "sndtimeo", 3)
|
||||
ret=socket:connect(s.server,s.server_port)
|
||||
ret = socket:connect(s.server,s.server_port)
|
||||
if tostring(ret) == "true" then
|
||||
socket:close()
|
||||
retstring=retstring .. "<font color='green'>[" .. server_name .. "] OK.</font><br />"
|
||||
retstring = retstring .. "<font color = 'green'>[" .. server_name .. "] OK.</font><br />"
|
||||
else
|
||||
retstring=retstring .. "<font color='red'>[" .. server_name .. "] Error.</font><br />"
|
||||
retstring = retstring .. "<font color = 'red'>[" .. server_name .. "] Error.</font><br />"
|
||||
end
|
||||
if iret == 0 then
|
||||
luci.sys.call(" ipset del ss_spec_wan_ac " .. s.server)
|
||||
luci.sys.call("ipset del ss_spec_wan_ac " .. s.server)
|
||||
end
|
||||
end)
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ret=retstring})
|
||||
luci.http.write_json({ret = retstring})
|
||||
end
|
||||
|
@ -45,6 +45,20 @@ o.datatype = "uinteger"
|
||||
o:depends("enable_switch", "1")
|
||||
o.default = 3
|
||||
|
||||
o = s:option(Flag, "adblock", translate("Enable adblock"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "adblock_url", translate("adblock_url"))
|
||||
o:value("https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf", translate("anti-AD"))
|
||||
o.default = "https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf"
|
||||
o:depends("adblock", "1")
|
||||
o.description = translate("Support AdGuardHome and DNSMASQ format list")
|
||||
|
||||
o = s:option(Value, "gfwlist_url", translate("gfwlist Update url"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt", translate("Loukky/gfwlist-by-loukky"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt", translate("gfwlist/gfwlist"))
|
||||
o.default = "https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt"
|
||||
|
||||
o = s:option(Value, "chnroute_url", translate("Chnroute Update url"))
|
||||
o:value("https://ispip.clang.cn/all_cn.txt", translate("Clang.CN"))
|
||||
o.default = "https://ispip.clang.cn/all_cn.txt"
|
||||
@ -55,15 +69,6 @@ o:value("https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/getflix.t
|
||||
o.default = "https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/NF_only.txt"
|
||||
o.description = translate("Customize Netflix IP Url")
|
||||
|
||||
o = s:option(Flag, "adblock", translate("Enable adblock"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "adblock_url", translate("adblock_url"))
|
||||
o:value("https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf", translate("anti-AD"))
|
||||
o.default = "https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf"
|
||||
o:depends("adblock", "1")
|
||||
o.description = translate("Support AdGuardHome and DNSMASQ format list")
|
||||
|
||||
-- [[ SOCKS5 Proxy ]]--
|
||||
s = m:section(TypedSection, "socks5_proxy", translate("Global SOCKS5 Proxy Server"))
|
||||
s.anonymous = true
|
||||
|
@ -166,12 +166,6 @@ msgstr "编辑服务器配置"
|
||||
msgid "Alias"
|
||||
msgstr "别名"
|
||||
|
||||
msgid "SOCKS Proxy"
|
||||
msgstr "SOCKS(4/5)代理"
|
||||
|
||||
msgid "Enable SOCKS Proxy"
|
||||
msgstr "启用 SOCKS 代理"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "服务器"
|
||||
|
||||
@ -283,6 +277,9 @@ msgstr "【国内IP段】数据库"
|
||||
msgid "Netflix IP Data"
|
||||
msgstr "【Netflix IP段】数据库"
|
||||
|
||||
msgid "Advertising Data"
|
||||
msgstr "【广告屏蔽】数据库"
|
||||
|
||||
msgid "Records"
|
||||
msgstr "条记录"
|
||||
|
||||
@ -332,10 +329,16 @@ msgid "Enable adblock"
|
||||
msgstr "启用广告屏蔽"
|
||||
|
||||
msgid "adblock_url"
|
||||
msgstr "广告屏蔽订阅"
|
||||
msgstr "广告屏蔽更新URL"
|
||||
|
||||
msgid "gfwlist Update url"
|
||||
msgstr "GFWList更新URL"
|
||||
|
||||
msgid "Chnroute Update url"
|
||||
msgstr "国内IP段更新URL"
|
||||
|
||||
msgid "nfip_url"
|
||||
msgstr "Netflix IP更新URL"
|
||||
msgstr "Netflix IP段更新URL"
|
||||
|
||||
msgid "Customize Netflix IP Url"
|
||||
msgstr "自定义Netflix IP更新URL(默认项目地址:https://github.com/QiuSimons/Netflix_IP)"
|
||||
@ -343,15 +346,6 @@ msgstr "自定义Netflix IP更新URL(默认项目地址:https://github.com/Q
|
||||
msgid "Enable Process Deamon"
|
||||
msgstr "启用进程自动守护"
|
||||
|
||||
msgid "Advertising Data"
|
||||
msgstr "【广告屏蔽】数据库"
|
||||
|
||||
msgid "Chnroute Setting"
|
||||
msgstr "国内IP段数据库更新设置"
|
||||
|
||||
msgid "Update url"
|
||||
msgstr "更新链接"
|
||||
|
||||
msgid "DNS Server IP and Port"
|
||||
msgstr "DNS服务器地址和端口"
|
||||
|
||||
@ -496,24 +490,12 @@ msgstr "游戏模式UDP中继服务器"
|
||||
msgid "Game Mode UDP Relay"
|
||||
msgstr "游戏模式UDP中继"
|
||||
|
||||
msgid "adblock settings"
|
||||
msgstr "广告屏蔽设置"
|
||||
|
||||
msgid "Server failsafe auto swith and custom update settings"
|
||||
msgstr "服务器节点故障自动切换/广告屏蔽/国内IP段数据库更新设置"
|
||||
|
||||
msgid "Support AdGuardHome and DNSMASQ format list"
|
||||
msgstr "同时支持 AdGuard Home 和 DNSMASQ 格式的过滤列表"
|
||||
|
||||
msgid "Enable Custom Chnroute"
|
||||
msgstr "自定义国内IP段数据库更新"
|
||||
|
||||
msgid "Chnroute Update url"
|
||||
msgstr "国内IP段数据库更新URL"
|
||||
|
||||
msgid "Delete all severs"
|
||||
msgstr "删除所有服务器节点"
|
||||
|
||||
msgid "Delete All Subscribe Severs"
|
||||
msgstr "删除所有订阅服务器节点"
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,14 +11,13 @@ config global
|
||||
option switch_timeout '5'
|
||||
option switch_time '667'
|
||||
option switch_try_count '3'
|
||||
option adblock '0'
|
||||
option adblock_url 'https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf'
|
||||
option gfwlist_url 'https://raw.githubusercontent.com/Loukky/gfwlist-by-loukky/master/gfwlist.txt'
|
||||
option chnroute_url 'https://ispip.clang.cn/all_cn.txt'
|
||||
option nfip_url 'https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/NF_only.txt'
|
||||
option adblock_url 'https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf'
|
||||
option netflix_server 'same'
|
||||
option threads '0'
|
||||
|
||||
|
||||
config socks5_proxy
|
||||
option socks '0'
|
||||
option local_port '1080'
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -91,7 +91,7 @@ gen_config_file() {
|
||||
if echo $hostip | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
|
||||
hostip=$hostip
|
||||
else
|
||||
hostip=$(cat /etc/ssr_ip)
|
||||
hostip=$(cat /tmp/ssr_ip)
|
||||
fi
|
||||
fi
|
||||
[ "$2" == "0" -a "$kcp_flag" == "1" ] && hostip="127.0.0.1"
|
||||
@ -179,9 +179,9 @@ start_rules() {
|
||||
else
|
||||
server=$(ping $server -W 1 -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1)
|
||||
if echo $server | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
|
||||
echo $server >/etc/ssr_ip
|
||||
echo $server >/tmp/ssr_ip
|
||||
else
|
||||
server=$(cat /etc/ssr_ip)
|
||||
server=$(cat /tmp/ssr_ip)
|
||||
fi
|
||||
fi
|
||||
kcp_server=$server
|
||||
@ -435,7 +435,6 @@ start_redir() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$UDP_RELAY_SERVER" ]; then
|
||||
redir_udp=1
|
||||
if [ "$utype" == "ss" -o "$utype" == "ssr" ]; then
|
||||
@ -643,28 +642,24 @@ start() {
|
||||
/usr/share/shadowsocksr/gfw2ipset.sh
|
||||
|
||||
if [ "$NETFLIX_SERVER" != "$GLOBAL_SERVER" ]; then
|
||||
cat /etc/config/netflix.list | while read line || [ -n "$line" ];
|
||||
do
|
||||
cat /etc/config/netflix.list | while read line || [ -n "$line" ]; do
|
||||
sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_list.conf
|
||||
done
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"netflix"'\n",$0)}' /etc/config/netflix.list > /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5555"'\n",$0)}' /etc/config/netflix.list >> /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"netflix"'\n",$0)}' /etc/config/netflix.list >/tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5555"'\n",$0)}' /etc/config/netflix.list >>/tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
|
||||
ipset -N netflix hash:net 2>/dev/null
|
||||
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ];
|
||||
do
|
||||
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ]; do
|
||||
ipset add netflix $nip 2>/dev/null
|
||||
done
|
||||
else
|
||||
cat /etc/config/netflix.list | while read line || [ -n "$line" ];
|
||||
do
|
||||
cat /etc/config/netflix.list | while read line || [ -n "$line" ]; do
|
||||
sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_list.conf
|
||||
done
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"netflix"'\n",$0)}' /etc/config/netflix.list > /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/config/netflix.list >> /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"netflix"'\n",$0)}' /etc/config/netflix.list >/tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/config/netflix.list >>/tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
ipset -N netflix hash:net 2>/dev/null
|
||||
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ];
|
||||
do
|
||||
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ]; do
|
||||
ipset add netflix $nip 2>/dev/null
|
||||
done
|
||||
fi
|
||||
@ -739,7 +734,7 @@ stop() {
|
||||
kill -9 $(busybox ps -w | grep pdnsd | grep -v grep | awk '{print $1}') >/dev/null 2>&1
|
||||
fi
|
||||
if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then
|
||||
rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf
|
||||
rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf /tmp/dnsmasq.ssr/* /tmp/dnsmasq.oversea/*
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
del_cron
|
||||
|
@ -7,7 +7,7 @@ require 'nixio'
|
||||
require 'luci.util'
|
||||
require 'luci.jsonc'
|
||||
require 'luci.sys'
|
||||
local icount =0
|
||||
local icount = 0
|
||||
local uci = luci.model.uci.cursor()
|
||||
|
||||
local log = function(...)
|
||||
@ -15,7 +15,7 @@ local log = function(...)
|
||||
end
|
||||
|
||||
log('正在更新【GFW列表】数据库')
|
||||
refresh_cmd = "wget-ssl --no-check-certificate -O - https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt > /tmp/gfw.b64"
|
||||
refresh_cmd = "wget-ssl --no-check-certificate -O- " .. uci:get_first('shadowsocksr', 'global', 'gfwlist_url', 'https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt') .. ' > /tmp//tmp/gfw.b64'
|
||||
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret == 0 then
|
||||
luci.sys.call("/usr/bin/ssr-gfw")
|
||||
|
Loading…
x
Reference in New Issue
Block a user