Merge Lean's source

This commit is contained in:
CN_SZTL 2020-03-09 17:23:38 +08:00
commit f0b6095d3b
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
4 changed files with 16 additions and 20 deletions

View File

@ -14,8 +14,10 @@ s:tab("basic", translate("Base Setting"))
o = s:taboption("basic", Flag, "enabled", translate("Enable"))
proto = s:taboption("basic",Value,"proto", translate("Proto"))
proto:value("tcp", translate("TCP Server"))
proto:value("udp", translate("UDP Server"))
proto:value("tcp4", translate("TCP Server IPv4"))
proto:value("udp4", translate("UDP Server IPv4"))
proto:value("tcp6", translate("TCP Server IPv6"))
proto:value("udp6", translate("UDP Server IPv6"))
port = s:taboption("basic", Value, "port", translate("Port"))
port.datatype = "range(1,65535)"

View File

@ -83,7 +83,7 @@ if set == "gfw_data" then
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 /etc/dnsmasq.ssr/gfw_list.conf /tmp/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(math.ceil(tonumber(icount)/2))
else
@ -98,7 +98,7 @@ else
end
elseif set == "ip_data" then
if (luci.model.uci.cursor():get_first('shadowsocksr', 'global', 'chnroute', '0') == '1') then
refresh_cmd="wget-ssl --no-check-certificate -O - " .. luci.model.uci.cursor():get_first('shadowsocksr', 'global', 'chnroute_url', 'https://pexcn.me/daily/chnroute/chnroute.txt') .. ' > /tmp/china_ssr.txt 2>/dev/null'
refresh_cmd="wget-ssl --no-check-certificate -O - " .. luci.model.uci.cursor():get_first('shadowsocksr', 'global', 'chnroute_url', 'https://ispip.clang.cn/all_cn.txt') .. ' > /tmp/china_ssr.txt 2>/dev/null'
else
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt"
end
@ -132,11 +132,9 @@ if sret== 0 then
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(math.ceil(tonumber(icount)))
if oldcount==0 then
luci.sys.exec("cp -f /etc/dnsmasq.ssr/ad.conf /tmp/dnsmasq.ssr/ad.conf")
luci.sys.call("/etc/init.d/dnsmasq restart")
end
else
retstring ="0"
end

View File

@ -15,11 +15,7 @@ local log = function(...)
end
log('正在更新【GFW列表】数据库')
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O /tmp/gfw.b64"
else
refresh_cmd="wget -O /tmp/gfw.b64 http://iytc.net/tools/list.b64"
end
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/bin/ssr-gfw")
@ -28,7 +24,7 @@ if nixio.fs.access("/usr/bin/wget-ssl") then
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")
-- retstring=tostring(math.ceil(tonumber(icount)/2))
luci.sys.exec("cp -f /tmp/gfwnew.txt /tmp/dnsmasq.ssr/gfw_list.conf")
log('更新成功! 新的总纪录数:'.. icount)
else
log('你已经是最新数据,无需更新!')
@ -43,7 +39,7 @@ end
log('正在更新【国内IP段】数据库')
if (ucic:get_first('shadowsocksr', 'global', 'chnroute','0') == '1' ) then
refresh_cmd="wget-ssl --no-check-certificate -O - ".. ucic:get_first('shadowsocksr', 'global', 'chnroute_url','https://cdn.jsdelivr.net/gh/17mon/china_ip_list/china_ip_list.txt') .." > /tmp/china_ssr.txt 2>/dev/null"
refresh_cmd="wget-ssl --no-check-certificate -O - ".. ucic:get_first('shadowsocksr', 'global', 'chnroute_url','https://ispip.clang.cn/all_cn.txt') .." > /tmp/china_ssr.txt 2>/dev/null"
else
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt"
end
@ -55,7 +51,6 @@ if sret== 0 then
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")
-- retstring=tostring(math.ceil(tonumber(icount)/2))
log('更新成功! 新的总纪录数:'.. icount)
else
log('你已经是最新数据,无需更新!')
@ -85,10 +80,7 @@ if sret== 0 then
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf")
-- retstring=tostring(math.ceil(tonumber(icount)))
if oldcount==0 then
luci.sys.call("/etc/init.d/dnsmasq restart")
end
luci.sys.exec("cp -f /tmp/ad.conf /tmp/dnsmasq.ssr/ad.conf")
log('更新成功! 新的总纪录数:'.. icount)
else
log('你已经是最新数据,无需更新!')
@ -101,3 +93,5 @@ else
log('更新失败!')
end
end
luci.sys.call("/etc/init.d/dnsmasq restart")

View File

@ -257,6 +257,7 @@ define Device/glinet_gl-b1300
DEVICE_MODEL := GL-B1300
BOARD_NAME := gl-b1300
DEVICE_DTS := qcom-ipq4029-gl-b1300
BOARD_NAME := gl-b1300
KERNEL_SIZE := 4096k
IMAGE_SIZE := 26624k
IMAGES := sysupgrade.bin
@ -266,7 +267,8 @@ TARGET_DEVICES += glinet_gl-b1300
define Device/hugo_ac1200
$(call Device/FitImage)
DEVICE_TITLE := Hugo AC1200
DEVICE_VENDOR := Hugo
DEVICE_MODEL := AC1200
BOARD_NAME := hugo_ac1200
DEVICE_DTS := qcom-ipq4019-hugo-ac1200
KERNEL_SIZE := 4096k