Merge Mainline
This commit is contained in:
commit
b2a586b53d
19
package/ctcgfw/luci-app-argon-config/Makefile
Normal file
19
package/ctcgfw/luci-app-argon-config/Makefile
Normal file
@ -0,0 +1,19 @@
|
||||
#
|
||||
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-argon-config
|
||||
PKG_VERSION:=0.7
|
||||
PKG_RELEASE:=beta
|
||||
|
||||
LUCI_TITLE:=LuCI page for Argon Config
|
||||
LUCI_DEPENDS:=+luci-theme-argonv3
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -0,0 +1,12 @@
|
||||
--[[
|
||||
luci-app-argon-config
|
||||
]]--
|
||||
|
||||
module("luci.controller.argon-config", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access('/www/luci-static/argon/css/cascade.css') then
|
||||
return
|
||||
end
|
||||
entry({"admin", "system", "argon-config"}, form("argon-config/configuration"), _("Argon Config"),90)
|
||||
end
|
||||
@ -0,0 +1,216 @@
|
||||
local nxfs = require 'nixio.fs'
|
||||
local wa = require 'luci.tools.webadmin'
|
||||
local opkg = require 'luci.model.ipkg'
|
||||
local sys = require 'luci.sys'
|
||||
local http = require 'luci.http'
|
||||
local nutil = require 'nixio.util'
|
||||
local name = 'argon'
|
||||
local uci = require 'luci.model.uci'.cursor()
|
||||
|
||||
local fstat = nxfs.statvfs(opkg.overlay_root())
|
||||
local space_total = fstat and fstat.blocks or 0
|
||||
local space_free = fstat and fstat.bfree or 0
|
||||
local space_used = space_total - space_free
|
||||
|
||||
local free_byte = space_free * fstat.frsize
|
||||
|
||||
local primary, dark_primary, blur_radius, blur_radius_dark, blur_opacity, mode
|
||||
if nxfs.access('/etc/config/argon') then
|
||||
primary = uci:get_first('argon', 'global', 'primary')
|
||||
dark_primary = uci:get_first('argon', 'global', 'dark_primary')
|
||||
blur_radius = uci:get_first('argon', 'global', 'blur')
|
||||
blur_radius_dark = uci:get_first('argon', 'global', 'blur_dark')
|
||||
blur_opacity = uci:get_first('argon', 'global', 'transparency')
|
||||
blur_opacity_dark = uci:get_first('argon', 'global', 'transparency_dark')
|
||||
mode = uci:get_first('argon', 'global', 'mode')
|
||||
end
|
||||
|
||||
function glob(...)
|
||||
local iter, code, msg = nxfs.glob(...)
|
||||
if iter then
|
||||
return nutil.consume(iter)
|
||||
else
|
||||
return nil, code, msg
|
||||
end
|
||||
end
|
||||
|
||||
local transparency_sets = {
|
||||
0,
|
||||
0.1,
|
||||
0.2,
|
||||
0.3,
|
||||
0.4,
|
||||
0.5,
|
||||
0.6,
|
||||
0.7,
|
||||
0.8,
|
||||
0.9,
|
||||
1
|
||||
}
|
||||
|
||||
-- [[ 模糊设置 ]]--
|
||||
br = SimpleForm('config', translate('Argon Config'), translate('Here you can set the blur and transparency of the login page of argon theme, and manage the background pictures and videos.'))
|
||||
br.reset = false
|
||||
br.submit = false
|
||||
s = br:section(SimpleSection)
|
||||
|
||||
o = s:option(ListValue, 'mode', translate('Theme mode'))
|
||||
o:value('normal', translate('Follow System'))
|
||||
o:value('light', translate('Force Light'))
|
||||
o:value('dark', translate('Force Dark'))
|
||||
o.default = mode
|
||||
o.rmempty = false
|
||||
o.description = translate('You can choose Theme color mode here')
|
||||
|
||||
o = s:option(Value, 'primary', translate('[Light mode] Primary Color'), translate('A HEX Color ; ( Default: #5e72e4 )'))
|
||||
o.value = primary
|
||||
o.datatype = ufloat
|
||||
o.rmempty = false
|
||||
|
||||
|
||||
|
||||
o = s:option(ListValue, 'transparency', translate('[Light mode] Transparency'), translate('0 transparent - 1 opaque ; ( Suggest: transparent: 0 or translucent preset: 0.5 )'))
|
||||
for _, v in ipairs(transparency_sets) do
|
||||
o:value(v)
|
||||
end
|
||||
o.default = blur_opacity
|
||||
o.datatype = ufloat
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, 'blur', translate('[Light mode] Frosted Glass Radius'), translate('Larger value will more blurred ; ( Suggest: clear: 1 or blur preset: 10 )'))
|
||||
o.value = blur_radius
|
||||
o.datatype = ufloat
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, 'dark_primary', translate('[Dark mode] Primary Color'), translate('A HEX Color ; ( Default: #483d8b )'))
|
||||
o.value = dark_primary
|
||||
o.datatype = ufloat
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, 'transparency_dark', translate('[Dark mode] Transparency'), translate('0 transparent - 1 opaque ; ( Suggest: Black translucent preset: 0.5 )'))
|
||||
for _, v in ipairs(transparency_sets) do
|
||||
o:value(v)
|
||||
end
|
||||
o.default = blur_opacity_dark
|
||||
o.datatype = ufloat
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, 'blur_dark', translate('[Dark mode] Frosted Glass Radius'), translate('Larger value will more blurred ; ( Suggest: clear: 1 or blur preset: 10 )'))
|
||||
o.value = blur_radius_dark
|
||||
o.datatype = ufloat
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Button, 'save', translate('Save Changes'))
|
||||
o.inputstyle = 'reload'
|
||||
|
||||
function br.handle(self, state, data)
|
||||
if (state == FORM_VALID and data.blur ~= nil and data.blur_dark ~= nil and data.transparency ~= nil and data.transparency_dark ~= nil and data.mode ~= nil) then
|
||||
nxfs.writefile('/tmp/aaa', data)
|
||||
for key, value in pairs(data) do
|
||||
uci:set('argon','@global[0]',key,value)
|
||||
end
|
||||
uci:commit('argon')
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
ful = SimpleForm('upload', translate('Upload (Free: ') .. wa.byte_format(free_byte) .. ')', translate("You can upload files such as jpg,png,gif,mp4 files, To change the login page background."))
|
||||
ful.reset = false
|
||||
ful.submit = false
|
||||
|
||||
sul = ful:section(SimpleSection, '', translate("Upload file to '/www/luci-static/argon/background/'"))
|
||||
fu = sul:option(FileUpload, '')
|
||||
fu.template = 'argon-config/other_upload'
|
||||
um = sul:option(DummyValue, '', nil)
|
||||
um.template = 'argon-config/other_dvalue'
|
||||
|
||||
local dir, fd
|
||||
dir = '/www/luci-static/argon/background/'
|
||||
nxfs.mkdir(dir)
|
||||
http.setfilehandler(
|
||||
function(meta, chunk, eof)
|
||||
if not fd then
|
||||
if not meta then
|
||||
return
|
||||
end
|
||||
|
||||
if meta and chunk then
|
||||
fd = nixio.open(dir .. meta.file, 'w')
|
||||
end
|
||||
|
||||
if not fd then
|
||||
um.value = translate('Create upload file error.')
|
||||
return
|
||||
end
|
||||
end
|
||||
if chunk and fd then
|
||||
fd:write(chunk)
|
||||
end
|
||||
if eof and fd then
|
||||
fd:close()
|
||||
fd = nil
|
||||
um.value = translate('File saved to') .. ' "/www/luci-static/argon/background/' .. meta.file .. '"'
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
if http.formvalue('upload') then
|
||||
local f = http.formvalue('ulfile')
|
||||
if #f <= 0 then
|
||||
um.value = translate('No specify upload file.')
|
||||
end
|
||||
end
|
||||
|
||||
local function getSizeStr(size)
|
||||
local i = 0
|
||||
local byteUnits = {' kB', ' MB', ' GB', ' TB'}
|
||||
repeat
|
||||
size = size / 1024
|
||||
i = i + 1
|
||||
until (size <= 1024)
|
||||
return string.format('%.1f', size) .. byteUnits[i]
|
||||
end
|
||||
|
||||
local inits, attr = {}
|
||||
for i, f in ipairs(glob(dir .. '*')) do
|
||||
attr = nxfs.stat(f)
|
||||
if attr then
|
||||
inits[i] = {}
|
||||
inits[i].name = nxfs.basename(f)
|
||||
inits[i].mtime = os.date('%Y-%m-%d %H:%M:%S', attr.mtime)
|
||||
inits[i].modestr = attr.modestr
|
||||
inits[i].size = getSizeStr(attr.size)
|
||||
inits[i].remove = 0
|
||||
inits[i].install = false
|
||||
end
|
||||
end
|
||||
|
||||
form = SimpleForm('filelist', translate('Background file list'), nil)
|
||||
form.reset = false
|
||||
form.submit = false
|
||||
|
||||
tb = form:section(Table, inits)
|
||||
nm = tb:option(DummyValue, 'name', translate('File name'))
|
||||
mt = tb:option(DummyValue, 'mtime', translate('Modify time'))
|
||||
sz = tb:option(DummyValue, 'size', translate('Size'))
|
||||
btnrm = tb:option(Button, 'remove', translate('Remove'))
|
||||
btnrm.render = function(self, section, scope)
|
||||
self.inputstyle = 'remove'
|
||||
Button.render(self, section, scope)
|
||||
end
|
||||
|
||||
btnrm.write = function(self, section)
|
||||
local v = nxfs.unlink(dir .. nxfs.basename(inits[section].name))
|
||||
if v then
|
||||
table.remove(inits, section)
|
||||
end
|
||||
return v
|
||||
end
|
||||
|
||||
function IsIpkFile(name)
|
||||
name = name or ''
|
||||
local ext = string.lower(string.sub(name, -4, -1))
|
||||
return ext == '.ipk'
|
||||
end
|
||||
|
||||
return br, ful, form
|
||||
@ -0,0 +1,7 @@
|
||||
<%+cbi/valueheader%>
|
||||
<% if self:cfgvalue(section) ~= false then %>
|
||||
<input class="cbi-button cbi-input-<%=self.inputstyle or "button" %>" style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
|
||||
<% else %>
|
||||
-
|
||||
<% end %>
|
||||
<%+cbi/valuefooter%>
|
||||
@ -0,0 +1,8 @@
|
||||
<%+cbi/valueheader%>
|
||||
<span style="color: red">
|
||||
<%
|
||||
local val = self:cfgvalue(section) or self.default or ""
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</span>
|
||||
<%+cbi/valuefooter%>
|
||||
@ -0,0 +1,5 @@
|
||||
<%+cbi/valueheader%>
|
||||
<label class="cbi-value" style="display:inline-block; width: 130px" for="ulfile"><%:Choose local file:%></label>
|
||||
<input class="cbi-input-file" style="width: 400px" type="file" id="ulfile" name="ulfile" accept="image/png, image/jpeg, image/gif, video/mp4"/>
|
||||
<input type="submit" class="cbi-button cbi-input-apply" name="upload" value="<%:Upload%>" />
|
||||
<%+cbi/valuefooter%>
|
||||
124
package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po
Normal file
124
package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po
Normal file
@ -0,0 +1,124 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: dingpengyu <jerrykuku@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
"X-Generator: Poedit 2.3.1\n"
|
||||
|
||||
msgid "Argon Config"
|
||||
msgstr "Argon 主题设置"
|
||||
|
||||
msgid "Here you can set the blur and transparency of the login page of argon theme, and manage the background pictures and videos."
|
||||
msgstr "在这里你可以设置 argon 主题的登录页面的模糊和透明度,并管理背景图片与视频。"
|
||||
|
||||
msgid "Theme mode"
|
||||
msgstr "主题模式"
|
||||
|
||||
msgid "Follow System"
|
||||
msgstr "跟随系统"
|
||||
|
||||
msgid "Force Light"
|
||||
msgstr "强制亮色"
|
||||
|
||||
msgid "Force Dark"
|
||||
msgstr "强制暗色"
|
||||
|
||||
msgid "You can choose Theme color mode here"
|
||||
msgstr "你可以选择喜欢的主题模式"
|
||||
|
||||
msgid "[Light mode] Primary Color"
|
||||
msgstr "[亮色模式] 主色调"
|
||||
|
||||
msgid "[Dark mode] Primary Color"
|
||||
msgstr "[暗色模式] 主色调"
|
||||
|
||||
msgid "A HEX Color ; ( Default: #5e72e4 )"
|
||||
msgstr "十六进制颜色值 ( 预设为:#5e72e4 )"
|
||||
|
||||
msgid "A HEX Color ; ( Default: #483d8b )"
|
||||
msgstr "十六进制颜色值 ( 预设为:#483d8b )"
|
||||
|
||||
msgid "[Light mode] Transparency"
|
||||
msgstr "[亮色模式] 透明度"
|
||||
|
||||
msgid "[Light mode] Transparency"
|
||||
msgstr "[亮色模式] 透明度"
|
||||
|
||||
msgid "[Dark mode] Transparency"
|
||||
msgstr "[暗色模式] 透明度"
|
||||
|
||||
msgid "0 transparent - 1 opaque ; ( Suggest: transparent: 0 or translucent preset: 0.5 )"
|
||||
msgstr "0最透明 - 1不透明 ; ( 建议: 透明 0 或 半透明预设 0.5 )"
|
||||
|
||||
msgid "0 transparent - 1 opaque ; ( Suggest: Black translucent preset: 0.5 )"
|
||||
msgstr "0最透明 - 1不透明 ; ( 建议: 黑色半透明 0.5 )"
|
||||
|
||||
msgid "[Light mode] Frosted Glass Radius"
|
||||
msgstr "[亮色模式] 毛玻璃模糊半径"
|
||||
|
||||
msgid "[Dark mode] Frosted Glass Radius"
|
||||
msgstr "[暗色模式] 毛玻璃模糊半径"
|
||||
|
||||
msgid "Larger value will more blurred ; ( Suggest: clear: 1 or blur preset: 10 )"
|
||||
msgstr "值越大越模糊; ( 建议: 清透 1 或 模糊预设 10 )"
|
||||
|
||||
msgid "You can upload files such as jpg,png,gif,mp4 files, To change the login page background."
|
||||
msgstr "你可以上传jpg、png、gif或mp4文件,以创建自己喜欢的登录界面"
|
||||
|
||||
msgid "Save Changes"
|
||||
msgstr "保存更改"
|
||||
|
||||
msgid "Choose local file:"
|
||||
msgstr "选择本地文件:"
|
||||
|
||||
msgid "Couldn't open file:"
|
||||
msgstr "无法打开文件:"
|
||||
|
||||
msgid "Create upload file error."
|
||||
msgstr "创建上传文件失败。"
|
||||
|
||||
|
||||
msgid "File name"
|
||||
msgstr "文件名"
|
||||
|
||||
msgid "File saved to"
|
||||
msgstr "文件保存到"
|
||||
|
||||
msgid "FileTransfer"
|
||||
msgstr "文件传输"
|
||||
|
||||
msgid "Install"
|
||||
msgstr "安装"
|
||||
|
||||
msgid "Attributes"
|
||||
msgstr "属性"
|
||||
|
||||
msgid "Modify time"
|
||||
msgstr "修改时间"
|
||||
|
||||
msgid "No specify upload file."
|
||||
msgstr "未指定上传文件。"
|
||||
|
||||
msgid "Path on Route:"
|
||||
msgstr "路由根目录:"
|
||||
|
||||
msgid "Remove"
|
||||
msgstr "移除"
|
||||
|
||||
msgid "Size"
|
||||
msgstr "大小"
|
||||
|
||||
msgid "Upload (Free:"
|
||||
msgstr "上传 (剩余空间:"
|
||||
|
||||
msgid "Background file list"
|
||||
msgstr "背景文件列表"
|
||||
|
||||
msgid "Upload file to '/www/luci-static/argon/background/'"
|
||||
msgstr "文件将上传到'/www/luci-static/argon/background/'"
|
||||
@ -0,0 +1,8 @@
|
||||
config global
|
||||
option primary '#5e72e4'
|
||||
option dark_primary '#483d8b'
|
||||
option blur '10'
|
||||
option blur_dark '10'
|
||||
option transparency '0.5'
|
||||
option transparency_dark '0.5'
|
||||
option mode 'normal'
|
||||
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
sed -i 's/cbi.submit\"] = true/cbi.submit\"] = \"1\"/g' /usr/lib/lua/luci/dispatcher.lua
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@ -11,12 +11,12 @@ Atlas-全区,Atlas.rules
|
||||
战地1,Battlefield-1.rules
|
||||
战地4,BattleField-4.rules
|
||||
战地5,Battlefield-Ⅴ.rules,Battlefield-5.rules
|
||||
黑色沙漠-steam,BlackDesert-steam.rules
|
||||
黑色沙漠,Black-Desert.rules
|
||||
黑色幸存者,BlackSurvivor.rules
|
||||
剑灵台服,Blade%26Soul%20TW.rules
|
||||
剑灵-日服,Blade-%26-Soul-jp.rules
|
||||
剑灵-国服全部区服(UU规则),Blood-%26-Soul-CN-TestServer-NantianGuo-Alpha.rules
|
||||
剑灵-国服-南天国(测试版),Blood-%26-Soul-CN.rules
|
||||
剑灵台服,Blade%26Soul%20TW.rules,Blade&Soul TW.rules
|
||||
剑灵-日服,Blade-%26-Soul-jp.rules,Blade-&-Soul-jp.rules
|
||||
剑灵-国服全部区服(UU规则),Blood-%26-Soul-CN-TestServer-NantianGuo-Alpha.rules,Blood-&-Soul-CN-TestServer-NantianGuo-Alpha.rules
|
||||
剑灵-国服-南天国(测试版),Blood-%26-Soul-CN.rules,Blood-&-Soul-CN.rules
|
||||
无主之地3,Borderlands3-asia.rules
|
||||
使命召唤4:现代战争重置版,Call-Of-Duty-4-Modern-Warfare.rules
|
||||
使命召唤15亚服,Call-Of-Duty15-Asia.rules
|
||||
@ -59,6 +59,7 @@ GTA5,GTA-5.rules
|
||||
激战2,Guild-Wars-2.rules
|
||||
巫师昆特牌国际服,Gwent_The-Witcher-Card-game.rules
|
||||
杀手2外服,HITMAN2.rules
|
||||
光环:士官长合集,Halo-The-Master-Chief-Collection.rules
|
||||
荒野行动PC版-国服,HuangYeXingDong-cn.rules
|
||||
叛乱:沙漠风暴,Insurgency-Sandstorm.rules
|
||||
Jump大乱斗,Jump-Force.rules
|
||||
@ -85,9 +86,9 @@ NBA2K20,NBA2K20.rules
|
||||
Osu!,Osu!.rules
|
||||
守望先锋-亚服,Overwatch-Asia.rules
|
||||
守望先锋-美服,Overwatch-US.rules
|
||||
流亡黯道-国际服,Path%20Of%20Exile.rules
|
||||
流亡黯道-国际服,Path%20Of%20Exile.rules,Path Of Exile.rules
|
||||
流放之路,PathOfexile.rules
|
||||
梦幻之星2-日服(tx),PHANTASY%20STAR%20ONLINE2-JPtx.rules
|
||||
梦幻之星2-日服(tx),PHANTASY%20STAR%20ONLINE2-JPtx.rules,PHANTASY STAR ONLINE2-JPtx.rules
|
||||
行星边际2,PlanetSide-2.rules
|
||||
绝地求生大逃杀,PlayerUnknown's-Battlegrounds-update.rules,PlayerUnknowns-Battlegrounds-update.rules
|
||||
实况足球-2018,Pro-Evolution-Soccer-2018.rules
|
||||
@ -100,7 +101,8 @@ Osu!,Osu!.rules
|
||||
R2竞技场服,R2Arena.rules
|
||||
R2俄服官服,R2RU.rules
|
||||
R2美服,R2US.rules
|
||||
仙境传说OL台湾,RagnarokOnlineTW.rules
|
||||
仙境传说OL美国,Ragnarok-Online-2-us.rules
|
||||
仙境传说OL台湾,Ragnarok-Online-tw.rules
|
||||
荒野大镖客2,Red-dead-redemption2.rules
|
||||
无限法则,Ring-of-Elysium-asia.rules
|
||||
Roblox,Roblox.rules
|
||||
@ -126,6 +128,7 @@ Steam-社区(Beta),Steam.rules
|
||||
全境封锁,Tom-clancy's-The-Division-2.rules,Tom-clancys-The-Division-2.rules
|
||||
全境封锁2,Tom-clancy's-The-Division.rules,Tom-clancys-The-Division.rules
|
||||
未转变者Unturned,Unturned.rules
|
||||
无畏契约,Valorant.rules
|
||||
战争前线,War-thunder-steam.rules
|
||||
战争雷霆-steam,Warface.rules
|
||||
看门狗,Watch-Dogs.rules
|
||||
@ -133,10 +136,11 @@ Steam-社区(Beta),Steam.rules
|
||||
求生意志OL,Will-To-Live-Online.rules
|
||||
坦克世界-亚服,World-of-Tanks-Asia.rules
|
||||
坦克世界-国服,World-of-Tanks-cn.rules
|
||||
坦克世界闪电战,World-of-Tanks-Blitz.rules
|
||||
魔兽世界台服,World-of-warcraft-tw.rules
|
||||
战舰世界-亚服,World-of-Warships-US.rules
|
||||
战舰世界-美服,World-of-Warships.rules
|
||||
僵尸世界大战,Worldwar-Z.rules
|
||||
魔兽世界-欧服,WoW-EU.rules
|
||||
游戏王决斗链接,YO-GI-HO%20delulinks.rules
|
||||
游戏王决斗链接,YO-GI-HO%20delulinks.rules,YO-GI-HO delulinks.rules
|
||||
游侠对战平台,YouXiaDuiZhanPingTai.rules
|
||||
@ -1,70 +1,118 @@
|
||||
反劫持规则,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Guard/,Hijacking.yaml
|
||||
国内IP白名单,ConnersHua,ipcidr,DivineEngine/Profiles/master/Clash/RuleSet/Extra/,ChinaIP.yaml
|
||||
国内IP白名单(By lhie1),lhie1,ipcidr,lhie1/Rules/master/Clash/Provider/,Domestic%20IPs.yaml,Domestic IPs.yaml
|
||||
国内域名白名单,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/,China.yaml
|
||||
国内域名白名单(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Domestic.yaml
|
||||
国内流媒体合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/,StreamingCN.yaml
|
||||
国内流媒体国际版合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/,StreamingSE.yaml
|
||||
国外常用网站合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/,Global.yaml
|
||||
国外常用网站合集(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Proxy.yaml
|
||||
国外流媒体合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/,Streaming.yaml
|
||||
学术网站,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/,Scholar.yaml
|
||||
审计规则(建议直连),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Special.yaml
|
||||
广告规则,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Guard/,Advertising.yaml
|
||||
广告规则(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Reject.yaml
|
||||
微软服务,lhie1,classical,lhie1/Rules/master/Clash/Provider/,Microsoft.yaml
|
||||
隐私规则合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Guard/,Privacy.yaml
|
||||
ABC,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,ABC.yaml
|
||||
Abema TV,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Abema%20TV.yaml,Abema TV.yaml
|
||||
AbemaTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,AbemaTV.yaml
|
||||
All-4,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,All-4.yaml
|
||||
Amazon,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Amazon.yaml
|
||||
AppStore,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,AppStore.yaml
|
||||
AppStoreConnect,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,AppStoreConnect.yaml
|
||||
Apple FindMy,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,FindMy.yaml
|
||||
Apple Music,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,Music.yaml
|
||||
Apple News,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,News.yaml
|
||||
Apple SoftwareUpdate,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,SoftwareUpdate.list,SoftwareUpdate.yaml
|
||||
Apple News(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Apple%20News.yaml,Apple News.yaml
|
||||
Apple SoftwareUpdate,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,SoftwareUpdate.yaml
|
||||
Apple TV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,TV.yaml
|
||||
Apple TV(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Apple%20TV.yaml,Apple TV.yaml
|
||||
Apple TestFlight,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,TestFlight.yaml
|
||||
Apple iCloud,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,iCloud.yaml
|
||||
Apple,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,Apple.yaml
|
||||
Apple(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Apple.yaml,Apple-lhie1.yaml
|
||||
BBC iPlayer,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,BBC iPlayer.yaml
|
||||
BBC-iPlayer,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,BBC-iPlayer.yaml
|
||||
Bahamut,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Bahamut.yaml
|
||||
Bahamut(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Bahamut.yaml,Bahamut-lhie1.yaml
|
||||
Bilibili,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Bilibili.yaml
|
||||
DAZN,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,DAZN.yaml
|
||||
DAZN(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,DAZN.yaml,DAZN-lhie1.yaml
|
||||
Deezer,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,Deezer.yaml
|
||||
Disney Plus,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Disney%20Plus.yaml,Disney Plus.yaml
|
||||
DisneyPlus,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,DisneyPlus.yaml
|
||||
FOX,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,FOX.yaml
|
||||
Fox Now,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Fox%20Now.yaml,Fox Now.yaml
|
||||
Fox+,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Fox+.yaml
|
||||
GFW地址,ConnersHua,ipcidr,DivineEngine/Profiles/master/Clash/RuleSet/Extra/,IP-Blackhole.yaml
|
||||
GoogleDrive,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Google/,GoogleDrive.yaml
|
||||
GoogleSearch,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Google/,GoogleSearch.yaml
|
||||
HBO,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,HBO.yaml
|
||||
HBO(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,HBO.yaml,HBO-lhie1.yaml
|
||||
HBO-GO-HKG,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,HBO-GO-HKG.yaml
|
||||
HWTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,HWTV.yaml
|
||||
Himalaya,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Podcast/,Himalaya.list,Himalaya.yaml
|
||||
Himalaya,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Podcast/,Himalaya.yaml
|
||||
Hulu Japan,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Hulu Japan.yaml
|
||||
Hulu,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Hulu.yaml
|
||||
Hulu(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Hulu.yaml,Hulu-lhie1.yaml
|
||||
Hulu-JPN,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Hulu-JPN.yaml
|
||||
ITV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,ITV.yaml
|
||||
Instagram,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,Instagram.yaml
|
||||
JOOX,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,JOOX.yaml
|
||||
JOOX(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,JOOX.yaml,JOOX-lhie1.yaml
|
||||
Japonx,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Japonx.yaml
|
||||
KKBOX,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,KKBOX.yaml
|
||||
KKBOX(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,KKBOX.yaml,KKBOX-lhie1.yaml
|
||||
KKTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,KKTV.yaml
|
||||
KKTV(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,KKTV.yaml,KKTV-lhie1.yaml
|
||||
LINE-TV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,LINE-TV.yaml
|
||||
Letv,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Letv.yaml
|
||||
LiTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,LiTV.yaml
|
||||
Line TV,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Line%20TV.yaml,Line TV.yaml
|
||||
MOO,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,MOO.yaml
|
||||
My5,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,My5.yaml
|
||||
Netease Music,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Netease%20Music.yaml,Netease Music.yaml
|
||||
Netflix,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Netflix.yaml
|
||||
Netflix(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Netflix.yaml,Netflix-lhie1.yaml
|
||||
Now-E,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Now-E.yaml
|
||||
OneDrive,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Microsoft/,OneDrive.yaml
|
||||
PBS,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,PBS.yaml
|
||||
PBS(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,PBS.yaml,PBS-lhie1.yaml
|
||||
Pandora,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,Pandora.yaml
|
||||
Pandora(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Pandora.yaml,Pandora-lhie1.yaml
|
||||
PayPal,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/,PayPal.yaml
|
||||
PayPal(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,PayPal.yaml,PayPal-lhie1.yaml
|
||||
Pornhub,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Pornhub.yaml
|
||||
Pornhub(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Pornhub.yaml,Pornhub-lhie1.yaml
|
||||
Prime-Video,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Prime-Video.yaml
|
||||
Siri,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,Siri.yaml
|
||||
SoundCloud,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,SoundCloud.yaml
|
||||
Soundcloud(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Soundcloud.yaml,Soundcloud-lhie1.yaml
|
||||
Speedtest,lhie1,classical,lhie1/Rules/master/Clash/Provider/,Speedtest.yaml
|
||||
Spotify,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,Spotify.yaml
|
||||
Spotify(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Spotify.yaml,Spotify-lhie1.yaml
|
||||
Steam,lhie1,classical,lhie1/Rules/master/Clash/Provider/,Steam.yaml
|
||||
TIDAL,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,TIDAL.yaml
|
||||
TaiwanGood,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,TaiwanGood.yaml
|
||||
Telegram,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/,Telegram.yaml
|
||||
Telegram(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Telegram.yaml,Telegram-lhie1.yaml
|
||||
TelegramNL,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/,TelegramNL.yaml
|
||||
TelegramSG,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/,TelegramSG.yaml
|
||||
TelegramUS,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/,TelegramUS.yaml
|
||||
Tencent Video,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Tencent%20Video.yaml,Tencent Video.yaml
|
||||
TikTok,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,TikTok.yaml
|
||||
Twitch,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Live/,Twitch.list,Twitch.yaml
|
||||
Twitch,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Live/,Twitch.yaml
|
||||
ViuTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,ViuTV.yaml
|
||||
ViuTV(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,ViuTV.yaml,ViuTV-lhie1.yaml
|
||||
YouTube Music,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,YouTube%20Music.yaml,YouTube Music.yaml
|
||||
YouTube,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,YouTube.yaml
|
||||
YouTube(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,YouTube.yaml,YouTube-lhie1.yaml
|
||||
Youku,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Youku.yaml
|
||||
encoreTVB,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,encoreTVB.yaml
|
||||
encoreTVB(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,encoreTVB.yaml,encoreTVB-lhie1.yaml
|
||||
iCloud-email,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,Mail.yaml
|
||||
iQiyi,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,iQiyi.yaml
|
||||
myTV SUPER,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,myTV%20SUPER.yaml,myTV SUPER.yaml
|
||||
myTV-SUPER,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,myTV-SUPER.yaml
|
||||
niconico,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,niconico.yaml
|
||||
@ -35,7 +35,7 @@ o.write = function()
|
||||
end
|
||||
|
||||
if not NXFS.access("/tmp/rule_providers_name") then
|
||||
SYS.call("awk -F ',' '{print $5}' /etc/openclash/rule_providers.list > /tmp/rule_providers_name 2>/dev/null")
|
||||
SYS.call("awk -v d=',' -F ',' '{print $4d$5}' /etc/openclash/rule_providers.list > /tmp/rule_providers_name 2>/dev/null")
|
||||
end
|
||||
file = io.open("/tmp/rule_providers_name", "r");
|
||||
|
||||
@ -58,14 +58,15 @@ end
|
||||
for t,o in ipairs(e) do
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=string.sub(luci.sys.exec(string.format("grep -F ',%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2)
|
||||
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F ',%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $6}' 2>/dev/null",o)),1,-2)
|
||||
if e[t].filename == "" then
|
||||
e[t].filename=o
|
||||
e[t].name=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2)
|
||||
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $6}' 2>/dev/null",o)),1,-2)
|
||||
if e[t].lfilename == "" then
|
||||
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $5}' 2>/dev/null",o)),1,-2)
|
||||
end
|
||||
e[t].author=string.sub(luci.sys.exec(string.format("grep -F ',%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2)
|
||||
e[t].rule_type=string.sub(luci.sys.exec(string.format("grep -F ',%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $3}' 2>/dev/null",o)),1,-2)
|
||||
RULE_FILE="/etc/openclash/rule_provider/".. e[t].filename
|
||||
e[t].filename=o
|
||||
e[t].author=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2)
|
||||
e[t].rule_type=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $3}' 2>/dev/null",o)),1,-2)
|
||||
RULE_FILE="/etc/openclash/rule_provider/".. e[t].lfilename
|
||||
if fs.mtime(RULE_FILE) then
|
||||
e[t].size=i(fs.stat(RULE_FILE).size)
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
|
||||
@ -93,7 +94,7 @@ st.template="openclash/cfg_check"
|
||||
tp=tb:option(DummyValue,"rule_type",translate("Rule Type"))
|
||||
nm=tb:option(DummyValue,"name",translate("Rule Name"))
|
||||
au=tb:option(DummyValue,"author",translate("Rule Author"))
|
||||
fm=tb:option(DummyValue,"filename",translate("File Name"))
|
||||
fm=tb:option(DummyValue,"lfilename",translate("File Name"))
|
||||
sz=tb:option(DummyValue,"size",translate("Size"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
|
||||
|
||||
0
package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_chnroute.sh
Normal file → Executable file
0
package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_chnroute.sh
Normal file → Executable file
@ -1,15 +1,21 @@
|
||||
#!/bin/sh
|
||||
RULE_FILE_NAME="$1"
|
||||
if [ -z "$(grep ",$RULE_FILE_NAME" /etc/openclash/rule_providers.list 2>/dev/null)" ]; then
|
||||
DOWNLOAD_PATH=$(grep -F $RULE_FILE_NAME /etc/openclash/game_rules.list |awk -F ',' '{print $2}' 2>/dev/null)
|
||||
if [ -z "$(grep "$RULE_FILE_NAME" /etc/openclash/rule_providers.list 2>/dev/null)" ]; then
|
||||
DOWNLOAD_PATH=$(grep -F "$RULE_FILE_NAME" /etc/openclash/game_rules.list |awk -F ',' '{print $2}' 2>/dev/null)
|
||||
RULE_FILE_DIR="/etc/openclash/game_rules/$RULE_FILE_NAME"
|
||||
RULE_TYPE="game"
|
||||
else
|
||||
DOWNLOAD_PATH=$(grep -F ",$RULE_FILE_NAME" /etc/openclash/rule_providers.list |awk -F ',' '{print $4$5}' 2>/dev/null)
|
||||
DOWNLOAD_PATH=$(echo "$RULE_FILE_NAME" |awk -F ',' '{print $1$2}' 2>/dev/null)
|
||||
RULE_FILE_NAME=$(grep -F "$RULE_FILE_NAME" /etc/openclash/rule_providers.list |awk -F ',' '{print $NF}' 2>/dev/null)
|
||||
RULE_FILE_DIR="/etc/openclash/rule_provider/$RULE_FILE_NAME"
|
||||
RULE_TYPE="provider"
|
||||
fi
|
||||
|
||||
if [ -z "$DOWNLOAD_PATH" ]; then
|
||||
echo "${LOGTIME} Rule File【$RULE_FILE_NAME】 Download Error" >>$LOG_FILE
|
||||
return 0
|
||||
fi
|
||||
|
||||
TMP_RULE_DIR="/tmp/$RULE_FILE_NAME"
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
@ -33,19 +39,19 @@
|
||||
fi
|
||||
|
||||
if [ "$?" -eq "0" ] && [ -s "$TMP_RULE_DIR" ] && [ -z "$(grep "404: Not Found" "$TMP_RULE_DIR")" ]; then
|
||||
cmp -s $TMP_RULE_DIR $RULE_FILE_DIR
|
||||
cmp -s "$TMP_RULE_DIR" "$RULE_FILE_DIR"
|
||||
if [ "$?" -ne "0" ]; then
|
||||
mv $TMP_RULE_DIR $RULE_FILE_DIR >/dev/null 2>&1\
|
||||
&& rm -rf $TMP_RULE_DIR >/dev/null 2>&1
|
||||
mv "$TMP_RULE_DIR" "$RULE_FILE_DIR" >/dev/null 2>&1\
|
||||
&& rm -rf "$TMP_RULE_DIR" >/dev/null 2>&1
|
||||
echo "${LOGTIME} Rule File【$RULE_FILE_NAME】 Download Successful" >>$LOG_FILE
|
||||
return 1
|
||||
else
|
||||
echo "${LOGTIME} Updated Rule File【$RULE_FILE_NAME】 No Change, Do Nothing" >>$LOG_FILE
|
||||
rm -rf $TMP_RULE_DIR >/dev/null 2>&1
|
||||
rm -rf "$TMP_RULE_DIR" >/dev/null 2>&1
|
||||
return 2
|
||||
fi
|
||||
else
|
||||
rm -rf $TMP_RULE_DIR >/dev/null 2>&1
|
||||
rm -rf "$TMP_RULE_DIR" >/dev/null 2>&1
|
||||
echo "${LOGTIME} Rule File【$RULE_FILE_NAME】 Download Error" >>$LOG_FILE
|
||||
return 0
|
||||
fi
|
||||
0
package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_ps.sh
Normal file → Executable file
0
package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_ps.sh
Normal file → Executable file
@ -1,6 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_FILE="/tmp/yaml_script.yaml"
|
||||
OTHER_RULE_PROVIDER_FILE="/tmp/other_rule_provider.yaml"
|
||||
OTHER_RULE_FILE="/tmp/other_rule.yaml"
|
||||
check_def=0
|
||||
|
||||
/usr/share/openclash/yml_groups_name_get.sh
|
||||
|
||||
yml_other_set()
|
||||
@ -209,82 +213,83 @@ if [ "$2" != 0 ]; then
|
||||
sed -i '/##Other-rule-providers##/,/##Other-rule-providers-end##/d' "$9" 2>/dev/null
|
||||
if [ "$2" = "lhie1" ]; then
|
||||
#删除原有的script部分,防止冲突
|
||||
rm -rf /tmp/yaml_script.yaml 2>/dev/null
|
||||
cp /etc/openclash/lhie1.yaml /tmp/other_rule_provider.yaml
|
||||
sed -n '/^ \{0,\}rules:/,$p' /tmp/other_rule_provider.yaml > /tmp/other_rule.yaml 2>/dev/null
|
||||
sed -i '/^ \{0,\}rules:/,$d' /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
sed -n '/^ \{0,\}script:/,$p' /tmp/other_rule_provider.yaml > /tmp/yaml_script.yaml 2>/dev/null
|
||||
sed -i '/^ \{0,\}script:/,$d' /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
sed -i "/^ \{0,\}script:/c\script:" /tmp/other_rule.yaml 2>/dev/null
|
||||
sed -i "/^ \{0,\}rules:/c\rules:" /tmp/other_rule.yaml 2>/dev/null
|
||||
sed -i "/^ \{0,\}rule-providers:/c\rule-providers:" /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
echo "##Other-rule-providers-end##" >> /tmp/other_rule_provider.yaml
|
||||
rm -rf "$SCRIPT_FILE" 2>/dev/null
|
||||
cp /etc/openclash/lhie1.yaml "$OTHER_RULE_PROVIDER_FILE"
|
||||
sed -n '/^ \{0,\}rules:/,$p' "$OTHER_RULE_PROVIDER_FILE" > "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i '/^ \{0,\}rules:/,$d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
sed -n '/^ \{0,\}script:/,$p' "$OTHER_RULE_PROVIDER_FILE" > "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i '/^ \{0,\}script:/,$d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
sed -i "/^ \{0,\}script:/c\script:" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "/^ \{0,\}rules:/c\rules:" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/^ \{0,\}rule-providers:/c\rule-providers:" "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
echo "##Other-rule-providers-end##" >> "$OTHER_RULE_PROVIDER_FILE"
|
||||
if [ -z "$(sed -n '/^ \{0,\}rule-providers:/=' "$9" 2>/dev/null)" ]; then
|
||||
sed -i "s/,GlobalTV$/,${GlobalTV}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"GlobalTV\"/: \"${GlobalTV}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,GlobalTV,no-resolve$/,${GlobalTV},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##GlobalTV:${GlobalTV}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,AsianTV$/,${AsianTV}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"AsianTV\"/: \"${AsianTV}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,AsianTV,no-resolve$/,${AsianTV},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##AsianTV:${AsianTV}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Proxy$/,${Proxy}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Proxy\"/: \"${Proxy}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Proxy,no-resolve$/,${Proxy},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Proxy:${Proxy}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,YouTube$/,${Youtube}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"YouTube\"/: \"${Youtube}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,YouTube,no-resolve$/,${Youtube},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Youtube:${Youtube}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Apple$/,${Apple}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Apple\"/: \"${Apple}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Apple,no-resolve$/,${Apple},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Apple:${Apple}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Netflix$/,${Netflix}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Netflix\"/: \"${Netflix}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Netflix,no-resolve$/,${Netflix},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Netflix:${Netflix}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Spotify$/,${Spotify}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Spotify\"/: \"${Spotify}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Spotify,no-resolve$/,${Spotify},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Spotify:${Spotify}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Steam$/,${Steam}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Steam\"/: \"${Steam}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Steam,no-resolve$/,${Steam},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Steam:${Steam}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,AdBlock$/,${AdBlock}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"AdBlock\"/: \"${AdBlock}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,AdBlock,no-resolve$/,${AdBlock},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##AdBlock:${AdBlock}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Speedtest$/,${Speedtest}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Speedtest\"/: \"${Speedtest}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Speedtest$/,${Speedtest},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Speedtest:${Speedtest}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Telegram$/,${Telegram}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Telegram\"/: \"${Telegram}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Telegram$/,${Telegram},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Telegram:${Telegram}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Microsoft$/,${Microsoft}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Microsoft\"/: \"${Microsoft}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Microsoft$/,${Microsoft},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Microsoft:${Microsoft}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,PayPal$/,${PayPal}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"PayPal\"/: \"${PayPal}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,PayPal$/,${PayPal},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##PayPal:${PayPal}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Domestic$/,${Domestic}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Domestic\"/: \"${Domestic}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/return \"Domestic\"$/return \"${Domestic}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Domestic$/,${Domestic},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Domestic:${Domestic}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Others$/,${Others}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/: \"Others\"/: \"${Others}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/return \"Others\"$/return \"${Others}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Others$/,${Others},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Others:${Others}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/#d//g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/^rule-providers:/c\rule-providers: ##Other-rule-providers##" /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
cat /tmp/other_rule_provider.yaml >> "$9" 2>/dev/null
|
||||
sed -i "s/,GlobalTV$/,${GlobalTV}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"GlobalTV\"/: \"${GlobalTV}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,GlobalTV,no-resolve$/,${GlobalTV},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##GlobalTV:${GlobalTV}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,AsianTV$/,${AsianTV}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"AsianTV\"/: \"${AsianTV}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,AsianTV,no-resolve$/,${AsianTV},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##AsianTV:${AsianTV}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Proxy$/,${Proxy}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Proxy\"/: \"${Proxy}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Proxy,no-resolve$/,${Proxy},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Proxy:${Proxy}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,YouTube$/,${Youtube}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"YouTube\"/: \"${Youtube}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,YouTube,no-resolve$/,${Youtube},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Youtube:${Youtube}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Apple$/,${Apple}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Apple\"/: \"${Apple}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Apple,no-resolve$/,${Apple},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Apple:${Apple}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Netflix$/,${Netflix}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Netflix\"/: \"${Netflix}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Netflix,no-resolve$/,${Netflix},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Netflix:${Netflix}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Spotify$/,${Spotify}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Spotify\"/: \"${Spotify}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Spotify,no-resolve$/,${Spotify},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Spotify:${Spotify}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Steam$/,${Steam}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Steam\"/: \"${Steam}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Steam,no-resolve$/,${Steam},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Steam:${Steam}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,AdBlock$/,${AdBlock}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"AdBlock\"/: \"${AdBlock}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,AdBlock,no-resolve$/,${AdBlock},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##AdBlock:${AdBlock}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Speedtest$/,${Speedtest}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Speedtest\"/: \"${Speedtest}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Speedtest$/,${Speedtest},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Speedtest:${Speedtest}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Telegram$/,${Telegram}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Telegram\"/: \"${Telegram}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Telegram$/,${Telegram},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Telegram:${Telegram}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Microsoft$/,${Microsoft}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Microsoft\"/: \"${Microsoft}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Microsoft$/,${Microsoft},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Microsoft:${Microsoft}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,PayPal$/,${PayPal}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"PayPal\"/: \"${PayPal}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,PayPal$/,${PayPal},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##PayPal:${PayPal}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Domestic$/,${Domestic}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Domestic\"/: \"${Domestic}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/return \"Domestic\"$/return \"${Domestic}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Domestic$/,${Domestic},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Domestic:${Domestic}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Others$/,${Others}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/: \"Others\"/: \"${Others}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/return \"Others\"$/return \"${Others}#d\"/g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "s/,Others$/,${Others},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Others:${Others}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/#d//g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/#d//g" "$SCRIPT_FILE" 2>/dev/null
|
||||
sed -i "/^rule-providers:/c\rule-providers: ##Other-rule-providers##" "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
cat "$OTHER_RULE_PROVIDER_FILE" >> "$9" 2>/dev/null
|
||||
else
|
||||
#处理缩进
|
||||
sed -i '/^ *$/d' "$9" 2>/dev/null
|
||||
@ -298,41 +303,41 @@ if [ "$2" != 0 ]; then
|
||||
sed -i 's/^ \{1,\}interval:/ interval:/g' "$9" 2>/dev/null
|
||||
sed -i 's/^ \{1,\}rule-providers:/rule-providers:/g' "$9" 2>/dev/null
|
||||
|
||||
sed -i '/^ \{0,\}rule-providers:/a\##Other-rule-providers##' /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
sed -i '/^ \{0,\}rule-providers:/d' "/tmp/other_rule_provider.yaml" 2>/dev/null
|
||||
sed -i '/^ \{0,\}rule-providers:/a\##Other-rule-providers##' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
sed -i '/^ \{0,\}rule-providers:/d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
sed -i '/rule-providers:/r/tmp/other_rule_provider.yaml' "$9" 2>/dev/null
|
||||
fi
|
||||
elif [ "$2" = "ConnersHua" ]; then
|
||||
cp /etc/openclash/ConnersHua.yaml /tmp/other_rule_provider.yaml
|
||||
sed -n '/^rules:/,$p' /tmp/other_rule_provider.yaml > /tmp/other_rule.yaml 2>/dev/null
|
||||
sed -i '/^rules:/,$d' /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
sed -i "/^ \{0,\}rule-providers:/c\rule-providers:" /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
echo "##Other-rule-providers-end##" >> /tmp/other_rule_provider.yaml
|
||||
cp /etc/openclash/ConnersHua.yaml "$OTHER_RULE_PROVIDER_FILE"
|
||||
sed -n '/^rules:/,$p' "$OTHER_RULE_PROVIDER_FILE" > "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i '/^rules:/,$d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
sed -i "/^ \{0,\}rule-providers:/c\rule-providers:" "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
echo "##Other-rule-providers-end##" >> "$OTHER_RULE_PROVIDER_FILE"
|
||||
if [ -z "$(sed -n '/^ \{0,\}rule-providers:/=' "$9" 2>/dev/null)" ]; then
|
||||
sed -i "s/,Streaming$/,${GlobalTV}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,Streaming,no-resolve$/,${GlobalTV},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##GlobalTV:${GlobalTV}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,StreamingSE$/,${AsianTV}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,StreamingSE,no-resolve$/,${AsianTV},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##AsianTV:${AsianTV}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,PROXY$/,${Proxy}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,PROXY,no-resolve$/,${Proxy},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,IP-Blackhole$/,${Proxy}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,IP-Blackhole,no-resolve$/,${Proxy},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Proxy:${Proxy}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,China,DIRECT$/,China,${Domestic}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,China,DIRECT,no-resolve$/,China,${Domestic},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,ChinaIP,DIRECT$/,ChinaIP,${Domestic}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,ChinaIP,DIRECT,no-resolve$/,ChinaIP,${Domestic},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,CN,DIRECT$/,CN,${Domestic}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,CN,DIRECT,no-resolve$/,CN,${Domestic},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Domestic:${Domestic}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,MATCH$/,${Others}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,MATCH,no-resolve$/,${Others},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Others:${Others}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/#d//g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/^rule-providers:/c\rule-providers: ##Other-rule-providers##" /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
cat /tmp/other_rule_provider.yaml >> "$9" 2>/dev/null
|
||||
sed -i "s/,Streaming$/,${GlobalTV}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,Streaming,no-resolve$/,${GlobalTV},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##GlobalTV:${GlobalTV}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,StreamingSE$/,${AsianTV}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,StreamingSE,no-resolve$/,${AsianTV},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##AsianTV:${AsianTV}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,PROXY$/,${Proxy}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,PROXY,no-resolve$/,${Proxy},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,IP-Blackhole$/,${Proxy}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,IP-Blackhole,no-resolve$/,${Proxy},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Proxy:${Proxy}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,China,DIRECT$/,China,${Domestic}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,China,DIRECT,no-resolve$/,China,${Domestic},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,ChinaIP,DIRECT$/,ChinaIP,${Domestic}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,ChinaIP,DIRECT,no-resolve$/,ChinaIP,${Domestic},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,CN,DIRECT$/,CN,${Domestic}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,CN,DIRECT,no-resolve$/,CN,${Domestic},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Domestic:${Domestic}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,MATCH$/,${Others}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,MATCH,no-resolve$/,${Others},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Others:${Others}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/#d//g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/^rule-providers:/c\rule-providers: ##Other-rule-providers##" "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
cat "$OTHER_RULE_PROVIDER_FILE" >> "$9" 2>/dev/null
|
||||
else
|
||||
#处理缩进
|
||||
sed -i '/^ *$/d' "$9" 2>/dev/null
|
||||
@ -346,21 +351,21 @@ if [ "$2" != 0 ]; then
|
||||
sed -i 's/^ \{1,\}interval:/ interval:/g' "$9" 2>/dev/null
|
||||
sed -i 's/^ \{1,\}rule-providers:/rule-providers:/g' "$9" 2>/dev/null
|
||||
|
||||
sed -i '/^ \{0,\}rule-providers:/a\##Other-rule-providers##' /tmp/other_rule_provider.yaml 2>/dev/null
|
||||
sed -i '/^ \{0,\}rule-providers:/d' "/tmp/other_rule_provider.yaml" 2>/dev/null
|
||||
sed -i '/^ \{0,\}rule-providers:/a\##Other-rule-providers##' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
sed -i '/^ \{0,\}rule-providers:/d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null
|
||||
sed -i '/rule-providers:/r/tmp/other_rule_provider.yaml' "$9" 2>/dev/null
|
||||
fi
|
||||
else
|
||||
cp /etc/openclash/ConnersHua_return.yaml /tmp/other_rule.yaml
|
||||
sed -i "s/,PROXY$/,${Proxy}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,PROXY,no-resolve$/,${Proxy},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Proxy:${Proxy}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,DIRECT$/,${Others}#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/,DIRECT,no-resolve$/,${Others},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "/rules:/a\##Others:${Others}" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
sed -i "s/#d//g" "/tmp/other_rule.yaml" 2>/dev/null
|
||||
cp /etc/openclash/ConnersHua_return.yaml "$OTHER_RULE_FILE"
|
||||
sed -i "s/,PROXY$/,${Proxy}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,PROXY,no-resolve$/,${Proxy},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Proxy:${Proxy}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,DIRECT$/,${Others}#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/,DIRECT,no-resolve$/,${Others},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "/rules:/a\##Others:${Others}" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
sed -i "s/#d//g" "$OTHER_RULE_FILE" 2>/dev/null
|
||||
fi
|
||||
cat /tmp/other_rule.yaml >> "$4" 2>/dev/null
|
||||
cat "$OTHER_RULE_FILE" >> "$4" 2>/dev/null
|
||||
rm -rf /tmp/other_rule* 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
@ -370,7 +375,7 @@ elif [ "$2" = 0 ]; then
|
||||
if [ "$?" -eq "0" ]; then
|
||||
sed -i '/^rules:/,$d' "$4" 2>/dev/null
|
||||
rm -rf /tmp/yaml_rule_provider.yaml 2>/dev/null
|
||||
rm -rf /tmp/yaml_script.yaml 2>/dev/null
|
||||
rm -rf "$SCRIPT_FILE" 2>/dev/null
|
||||
cat "/tmp/yaml_rule_provider_bak.yaml" >> "$4" 2>/dev/null
|
||||
cat "/tmp/yaml_script_bak.yaml" >> "$4" 2>/dev/null
|
||||
cat "/tmp/yaml_rules_bak.yaml" >> "$4" 2>/dev/null
|
||||
|
||||
@ -934,7 +934,7 @@ msgid "Order Number"
|
||||
msgstr "序号"
|
||||
|
||||
msgid "Game Rules Manage"
|
||||
msgstr "管理游戏规则"
|
||||
msgstr "管理第三方游戏规则"
|
||||
|
||||
msgid "Other Rule Provider Manage"
|
||||
msgstr "管理第三方规则集"
|
||||
|
||||
@ -9,10 +9,10 @@ function index()
|
||||
return
|
||||
end
|
||||
local page
|
||||
page = entry({"admin", "vpn", "ssocks"}, cbi("ssocks"), _("sSocks Server"), 100)
|
||||
page = entry({"admin", "services", "ssocks"}, cbi("ssocks"), _("sSocks Server"), 100)
|
||||
page.i18n = "ssocks"
|
||||
page.dependent = true
|
||||
entry({"admin", "vpn", "ssocks", "status"},call("act_status")).leaf=true
|
||||
entry({"admin", "services", "ssocks", "status"},call("act_status")).leaf=true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[vpn]], [[ssocks]], [[status]])%>', null,
|
||||
XHR.poll(3, '<%=url([[admin]], [[services]], [[ssocks]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('ssocks_status');
|
||||
if (data && tb) {
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=naiveproxy
|
||||
PKG_VERSION:=85.0.4183.83-2
|
||||
PKG_VERSION:=85.0.4183.83-3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/klzgrad/naiveproxy/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=620ca571615ee15d5de4c7723beb1fd3eb806413bbb992c3abcb3972d1a68cae
|
||||
PKG_HASH:=66a8f275a9aa0fa04649062fb141a10add9bd76855f32ee65e6ee60a7fc4649c
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=BSD 3-Clause
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic-Go
|
||||
PKG_VERSION:=0.2.5
|
||||
PKG_VERSION:=0.2.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/cnsilvan/UnblockNeteaseMusic.git
|
||||
PKG_SOURCE_VERSION:=aa1eb0186206671de9a6b4fa27d933bb306d4e25
|
||||
PKG_SOURCE_VERSION:=7ff431267eb2b2683ea25e1b3860447aa7b482e9
|
||||
PKG_MAINTAINER:=Silvan <cnsilvan@gmail.com>
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for UnblockNeteaseMusic Go
|
||||
LUCI_DEPENDS:=+bash +busybox +coreutils-nohup +curl +dnsmasq-full +openssl-util +ipset +UnblockNeteaseMusic-Go
|
||||
LUCI_DEPENDS:=+bash +busybox +coreutils +coreutils-nohup +curl +dnsmasq-full +openssl-util +ipset +UnblockNeteaseMusic-Go
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_NAME:=luci-app-unblockneteasemusic-go
|
||||
PKG_VERSION:=1.8
|
||||
PKG_VERSION:=1.9
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=https://github.com/cnsilvan/luci-app-unblockneteasemusic
|
||||
|
||||
@ -48,6 +48,10 @@ hijack.description = translate("如果使用Hosts劫持,请将HTTP/HTTPS端口
|
||||
hijack.default = "dont_hijack"
|
||||
hijack.rmempty = false
|
||||
|
||||
search_limit = s:option(Value, "search_limit", translate("搜索结果限制"))
|
||||
search_limit.description = translate("在搜索页面显示其他平台搜索结果个数,可填(0-3)")
|
||||
search_limit.default = "0"
|
||||
search_limit.rmempty = false
|
||||
|
||||
daemon_enable = s:option(Flag, "daemon_enable", translate("启用进程守护"))
|
||||
daemon_enable.description = translate("开启后,附属程序会自动检测主程序运行状态,在主程序退出时自动重启")
|
||||
|
||||
@ -140,9 +140,9 @@ start() {
|
||||
exArgs="${exArgs} -b"
|
||||
fi
|
||||
if [ "${music_source}" = "default" ]; then
|
||||
nohup UnblockNeteaseMusic -p "${http_port}" -sp "${https_port}" -o kuwo -m 0 -c "${serverCrt}" -k "${serverKey}" ${exArgs} >>"${logFile}" 2>&1 &
|
||||
nohup UnblockNeteaseMusic -p "${http_port}" -sp "${https_port}" -o kuwo -m 0 -c "${serverCrt}" -k "${serverKey}" -l "${logFile}" -sl "${search_limit}" ${exArgs} >>"${logFile}" 2>&1 &
|
||||
else
|
||||
nohup UnblockNeteaseMusic -p "${http_port}" -sp "${https_port}" -o "${music_customize_source}" -m 0 -c "${serverCrt}" -k "${serverKey}" ${exArgs} >>"${logFile}" 2>&1 &
|
||||
nohup UnblockNeteaseMusic -p "${http_port}" -sp "${https_port}" -o "${music_customize_source}" -m 0 -c "${serverCrt}" -k "${serverKey}" -l "${logFile}" -sl "${search_limit}" ${exArgs} >>"${logFile}" 2>&1 &
|
||||
fi
|
||||
set_type="start"
|
||||
if [ "${hijack_ways}" = "use_ipset" ]; then
|
||||
|
||||
@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=3.9
|
||||
PKG_RELEASE:=56
|
||||
PKG_DATE:=20200907
|
||||
PKG_RELEASE:=57
|
||||
PKG_DATE:=20200912
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
@ -55,12 +55,14 @@ s.sortable = true
|
||||
if nodes_display:find("compact_display_nodes") then
|
||||
if show_group then show_group.width = "25%" end
|
||||
o = s:option(DummyValue, "remarks", translate("Remarks"))
|
||||
o.rawhtml = true
|
||||
o.cfgvalue = function(t, n)
|
||||
local str = ""
|
||||
local is_sub = m:get(n, "is_sub") or ""
|
||||
local group = m:get(n, "group") or ""
|
||||
local remarks = m:get(n, "remarks") or ""
|
||||
local type = m:get(n, "type") or ""
|
||||
str = str .. string.format("<input type='hidden' id='cbid.%s.%s.type' value='%s'>", appname, n, type)
|
||||
if type == "V2ray" then
|
||||
local protocol = m:get(n, "protocol")
|
||||
if protocol == "_balancing" then
|
||||
@ -73,8 +75,9 @@ if nodes_display:find("compact_display_nodes") then
|
||||
local port = m:get(n, "port") or ""
|
||||
str = str .. translate(type) .. ":" .. remarks
|
||||
if address ~= "" and port ~= "" then
|
||||
local s = " (" .. address .. ":" .. port .. ")"
|
||||
str = str .. s
|
||||
str = str .. string.format("(%s:%s)", address, port)
|
||||
str = str .. string.format("<input type='hidden' id='cbid.%s.%s.address' value='%s'>", appname, n, address)
|
||||
str = str .. string.format("<input type='hidden' id='cbid.%s.%s.port' value='%s'>", appname, n, port)
|
||||
end
|
||||
return str
|
||||
end
|
||||
@ -89,7 +92,6 @@ else
|
||||
else
|
||||
return '手动'
|
||||
end
|
||||
return str
|
||||
end
|
||||
end
|
||||
|
||||
@ -130,23 +132,12 @@ end
|
||||
|
||||
---- Ping
|
||||
o = s:option(DummyValue, "ping", translate("Latency"))
|
||||
o.width = "6%"
|
||||
o.width = "8%"
|
||||
if not nodes_ping:find("auto_ping") then
|
||||
o.template = appname .. "/node_list/ping"
|
||||
else
|
||||
o.template = appname .. "/node_list/auto_ping"
|
||||
end
|
||||
--[[
|
||||
o.cfgvalue = function(t, n)
|
||||
local type = m:get(n, "type") or ""
|
||||
if type == "V2ray" then
|
||||
local protocol = m:get(n, "protocol","")
|
||||
if protocol == "_balancing" or protocol == "_shunt" then
|
||||
return "---"
|
||||
end
|
||||
end
|
||||
end
|
||||
--]]
|
||||
|
||||
m:append(Template(appname .. "/node_list/node_list"))
|
||||
|
||||
|
||||
@ -197,21 +197,11 @@ table td, .table .td {
|
||||
}
|
||||
|
||||
function get_address_full(id) {
|
||||
<% if nodes_display:find("compact_display_nodes") then %>
|
||||
var remarks = document.getElementById("cbid.passwall." + id + ".remarks").value;
|
||||
var result = remarks.match("\\((.+?)\\)");
|
||||
if (result != null) {
|
||||
var full = result[1];
|
||||
var address = full.substring(0, full.lastIndexOf(":"));
|
||||
var port = full.substring(full.lastIndexOf(":") + 1);
|
||||
}
|
||||
<% else %>
|
||||
try {
|
||||
var address = document.getElementById("cbid.passwall." + id + ".address").value;
|
||||
var port = document.getElementById("cbid.passwall." + id + ".port").value;
|
||||
}
|
||||
catch(err){}
|
||||
<% end %>
|
||||
try {
|
||||
var address = document.getElementById("cbid.passwall." + id + ".address").value;
|
||||
var port = document.getElementById("cbid.passwall." + id + ".port").value;
|
||||
}
|
||||
catch(err){}
|
||||
//判断是否含有汉字
|
||||
var reg = new RegExp("[\\u4E00-\\u9FFF]+","g");
|
||||
if ((address != null && address != "") && (port != null && port != "") && reg.test(address) == false && (address.indexOf(".") != -1 && address.charAt(address.address - 1) != ".")) {
|
||||
|
||||
@ -323,6 +323,10 @@ run_socks() {
|
||||
else
|
||||
msg="某种原因,此 Socks 服务的相关配置已失联,启动中止!"
|
||||
fi
|
||||
|
||||
if [ "$type" == "v2ray" ] && ([ -n "$(config_n_get $node balancing_node)" ] || [ "$(config_n_get $node default_node)" != "nil" ]); then
|
||||
unset msg
|
||||
fi
|
||||
|
||||
[ -n "${msg}" ] && {
|
||||
echolog " - ${msg}"
|
||||
@ -330,34 +334,43 @@ run_socks() {
|
||||
}
|
||||
echolog " - 节点:$remarks,${server_host}:${port}"
|
||||
|
||||
if [ "$type" == "socks" ]; then
|
||||
echolog " - 不能使用 Socks 类型的代理节点"
|
||||
elif [ "$type" == "v2ray" ]; then
|
||||
case "$type" in
|
||||
socks)
|
||||
local _username=$(config_n_get $node username)
|
||||
local _password=$(config_n_get $node password)
|
||||
[ -n "$_username" ] && [ -n "$_password" ] && local _auth="--uname $_username --passwd $_password"
|
||||
ln_start_bin "$(first_type ssocks)" ssocks_SOCKS_$5 --listen $local_port --socks $server_host:$port $_auth
|
||||
unset _username _password _auth
|
||||
;;
|
||||
v2ray)
|
||||
lua $API_GEN_V2RAY $node nil nil $local_port > $config_file
|
||||
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray -config="$config_file"
|
||||
elif [ "$type" == "trojan" ]; then
|
||||
lua $API_GEN_TROJAN $node client $bind $local_port > $config_file
|
||||
ln_start_bin "$(first_type trojan trojan-plus)" trojan -c "$config_file"
|
||||
elif [ "$type" == "trojan-plus" ]; then
|
||||
lua $API_GEN_TROJAN $node client $bind $local_port > $config_file
|
||||
ln_start_bin "$(first_type trojan-plus trojan)" trojan-plus -c "$config_file"
|
||||
elif [ "$type" == "trojan-go" ]; then
|
||||
;;
|
||||
trojan-go)
|
||||
lua $API_GEN_TROJAN $node client $bind $local_port > $config_file
|
||||
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go -config "$config_file"
|
||||
elif [ "$type" == "naiveproxy" ]; then
|
||||
;;
|
||||
trojan*)
|
||||
lua $API_GEN_TROJAN $node client $bind $local_port > $config_file
|
||||
ln_start_bin "$(first_type ${type})" "${type}" -c "$config_file"
|
||||
;;
|
||||
naiveproxy)
|
||||
lua $API_GEN_NAIVE $node socks $bind $local_port > $config_file
|
||||
ln_start_bin "$(first_type naive)" naive "$config_file"
|
||||
elif [ "$type" == "brook" ]; then
|
||||
;;
|
||||
brook)
|
||||
local protocol=$(config_n_get $node protocol client)
|
||||
local brook_tls=$(config_n_get $node brook_tls 0)
|
||||
[ "$protocol" == "wsclient" ] && {
|
||||
[ "$brook_tls" == "1" ] && server_host="wss://${server_host}" || server_host="ws://${server_host}"
|
||||
}
|
||||
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_socks_$5" "$protocol" --socks5 "$bind:$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
|
||||
elif [ "$type" == "ssr" ] || [ "$type" == "ss" ]; then
|
||||
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_SOCKS_$5" "$protocol" --socks5 "$bind:$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
|
||||
;;
|
||||
ss|ssr)
|
||||
lua $API_GEN_SS $node $local_port > $config_file
|
||||
ln_start_bin "$(first_type ${type}-local)" "${type}-local" -c "$config_file" -b "$bind" -u
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
run_redir() {
|
||||
@ -379,47 +392,54 @@ run_redir() {
|
||||
echolog "$remarks节点,非法的服务器地址,无法启动!"
|
||||
return 1
|
||||
}
|
||||
[ "$server_host" == "127.0.0.1" ] && process=1
|
||||
[ "$bind" != "127.0.0.1" ] && echolog "${redir_type}_${6}节点:$remarks,节点:${server_host}:${port},监听端口:$local_port"
|
||||
}
|
||||
eval ${redir_type}_NODE${6}_PORT=$port
|
||||
|
||||
if [ "$redir_type" == "UDP" ]; then
|
||||
if [ "$type" == "socks" ]; then
|
||||
|
||||
case "$redir_type" in
|
||||
UDP)
|
||||
case "$type" in
|
||||
socks)
|
||||
local node_address=$(config_n_get $node address)
|
||||
local node_port=$(config_n_get $node port)
|
||||
local server_username=$(config_n_get $node username)
|
||||
local server_password=$(config_n_get $node password)
|
||||
eval port=\$UDP_REDIR_PORT$6
|
||||
ln_start_bin "$(first_type ipt2socks)" "ipt2socks_udp_$6" -U -l "$port" -b 0.0.0.0 -s "$node_address" -p "$node_port" -R
|
||||
elif [ "$type" == "v2ray" ]; then
|
||||
;;
|
||||
v2ray)
|
||||
lua $API_GEN_V2RAY $node udp $local_port nil > $config_file
|
||||
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray -config="$config_file"
|
||||
elif [ "$type" == "trojan" ]; then
|
||||
lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port >$config_file
|
||||
ln_start_bin "$(first_type trojan trojan-plus)" trojan -c "$config_file"
|
||||
elif [ "$type" == "trojan-plus" ]; then
|
||||
lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port >$config_file
|
||||
ln_start_bin "$(first_type trojan-plus trojan)" trojan-plus -c "$config_file"
|
||||
elif [ "$type" == "trojan-go" ]; then
|
||||
;;
|
||||
trojan-go)
|
||||
lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port >$config_file
|
||||
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go -config "$config_file"
|
||||
elif [ "$type" == "naiveproxy" ]; then
|
||||
;;
|
||||
trojan*)
|
||||
lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port >$config_file
|
||||
ln_start_bin "$(first_type ${type})" "${type}" -c "$config_file"
|
||||
;;
|
||||
naiveproxy)
|
||||
echolog "Naiveproxy不支持UDP转发!"
|
||||
elif [ "$type" == "brook" ]; then
|
||||
;;
|
||||
brook)
|
||||
local protocol=$(config_n_get $node protocol client)
|
||||
if [ "$protocol" == "wsclient" ]; then
|
||||
echolog "Brook的WebSocket不支持UDP转发!"
|
||||
else
|
||||
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_udp_$6" tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
|
||||
fi
|
||||
elif [ "$type" == "ssr" ] || [ "$type" == "ss" ]; then
|
||||
;;
|
||||
ss|ssr)
|
||||
lua $API_GEN_SS $node $local_port > $config_file
|
||||
ln_start_bin "$(first_type ${type}-redir)" "${type}-redir" -c "$config_file" -U
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$redir_type" == "TCP" ]; then
|
||||
if [ "$type" == "socks" ]; then
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
TCP)
|
||||
case "$type" in
|
||||
socks)
|
||||
local node_address=$(config_n_get $node address)
|
||||
local node_port=$(config_n_get $node port)
|
||||
local server_username=$(config_n_get $node username)
|
||||
@ -428,28 +448,36 @@ run_redir() {
|
||||
local extra_param="-T"
|
||||
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param=""
|
||||
ln_start_bin "$(first_type ipt2socks)" "ipt2socks_tcp_$6" -l "$port" -b 0.0.0.0 -s "$node_address" -p "$node_port" -R $extra_param
|
||||
elif [ "$type" == "v2ray" ]; then
|
||||
;;
|
||||
v2ray)
|
||||
local extra_param="tcp"
|
||||
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param="tcp,udp"
|
||||
lua $API_GEN_V2RAY $node $extra_param $local_port nil > $config_file
|
||||
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray -config="$config_file"
|
||||
elif [ "$type" == "trojan" ]; then
|
||||
lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port > $config_file
|
||||
for k in $(seq 1 $process); do
|
||||
ln_start_bin "$(first_type trojan trojan-plus)" trojan -c "$config_file"
|
||||
done
|
||||
elif [ "$type" == "trojan-plus" ]; then
|
||||
lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port > $config_file
|
||||
for k in $(seq 1 $process); do
|
||||
ln_start_bin "$(first_type trojan-plus trojan)" trojan-plus -c "$config_file"
|
||||
done
|
||||
elif [ "$type" == "trojan-go" ]; then
|
||||
;;
|
||||
trojan-go)
|
||||
lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port > $config_file
|
||||
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go -config "$config_file"
|
||||
elif [ "$type" == "naiveproxy" ]; then
|
||||
;;
|
||||
trojan*)
|
||||
lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port > $config_file
|
||||
for k in $(seq 1 $process); do
|
||||
ln_start_bin "$(first_type ${type})" "${type}" -c "$config_file"
|
||||
done
|
||||
;;
|
||||
naiveproxy)
|
||||
lua $API_GEN_NAIVE $node redir "0.0.0.0" $local_port > $config_file
|
||||
ln_start_bin "$(first_type naive)" naive "$config_file"
|
||||
else
|
||||
;;
|
||||
brook)
|
||||
local protocol=$(config_n_get $node protocol client)
|
||||
if [ "$protocol" == "wsclient" ]; then
|
||||
echolog "Brook的WebSocket不支持UDP转发!"
|
||||
else
|
||||
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_udp_$6" tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
local kcptun_use=$(config_n_get $node use_kcp 0)
|
||||
if [ "$kcptun_use" == "1" ]; then
|
||||
local kcptun_server_host=$(config_n_get $node kcp_server)
|
||||
@ -499,8 +527,10 @@ run_redir() {
|
||||
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" tproxy -l ":$local_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -751,6 +781,7 @@ start_dns() {
|
||||
if [ -n "$(echo ${DNS_MODE} | grep 'https-dns-proxy')" ]; then
|
||||
up_trust_doh=$(config_t_get global up_trust_doh "https://dns.google/dns-query,8.8.8.8,8.8.4.4")
|
||||
_doh_url=$(echo $up_trust_doh | awk -F ',' '{print $1}')
|
||||
_doh_port=$(echo $_doh_url | sed "s/:\/\///g" | awk -F ':' '{print $2}'| awk -F '/' '{print $1}')
|
||||
_doh_bootstrap=$(echo $up_trust_doh | cut -d ',' -sf 2-)
|
||||
|
||||
up_trust_doh_dns=$(config_t_get global up_trust_doh_dns "tcp")
|
||||
@ -761,13 +792,13 @@ start_dns() {
|
||||
DNS_FORWARD=""
|
||||
_doh_bootstrap_dns=$(echo $_doh_bootstrap | sed "s/,/ /g")
|
||||
for _dns in $_doh_bootstrap_dns; do
|
||||
_dns=$(echo $_dns | awk -F ':' '{print $1}'):443
|
||||
_dns=$(echo $_dns | awk -F ':' '{print $1}'):${_doh_port:-443}
|
||||
[ -n "$DNS_FORWARD" ] && DNS_FORWARD=${DNS_FORWARD},${_dns} || DNS_FORWARD=${_dns}
|
||||
done
|
||||
ln_start_bin "$(first_type https-dns-proxy)" https-dns-proxy -a 127.0.0.1 -p "${dns_listen_port}" -b "${_doh_bootstrap}" -r "${_doh_url}" -4
|
||||
unset _dns _doh_bootstrap_dns
|
||||
fi
|
||||
unset _doh_url _doh_bootstrap
|
||||
unset _doh_url _doh_port _doh_bootstrap
|
||||
fi
|
||||
if [ -n "$(echo ${DNS_MODE}${up_trust_pdnsd_dns} | grep dns2socks)" ]; then
|
||||
local dns2socks_socks_server=$(echo $(config_t_get global socks_server 127.0.0.1:9050) | sed "s/#/:/g")
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=syncthing
|
||||
PKG_VERSION:=1.7.0
|
||||
PKG_VERSION:=1.9.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)
|
||||
PKG_HASH:=aee7ee49b65cb614711b9d8a7d468766adbb687fa5ba8f273eef495e4a8e9435
|
||||
PKG_HASH:=a4e3e5997b2c4c76512ed9b32a067b2a90e26c0d445f8c3c62af65d2b93d4d8b
|
||||
|
||||
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user