diff --git a/package/ctcgfw/luci-app-argon-config/Makefile b/package/ctcgfw/luci-app-argon-config/Makefile new file mode 100644 index 0000000000..1c94acc93c --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/Makefile @@ -0,0 +1,19 @@ +# +# Copyright (C) 2008-2014 The LuCI Team +# +# 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 diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/controller/argon-config.lua b/package/ctcgfw/luci-app-argon-config/luasrc/controller/argon-config.lua new file mode 100644 index 0000000000..8810e37f25 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/controller/argon-config.lua @@ -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 diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/model/cbi/argon-config/configuration.lua b/package/ctcgfw/luci-app-argon-config/luasrc/model/cbi/argon-config/configuration.lua new file mode 100644 index 0000000000..5af5374521 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/model/cbi/argon-config/configuration.lua @@ -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 diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_button.htm b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_button.htm new file mode 100644 index 0000000000..1c391ad984 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_button.htm @@ -0,0 +1,7 @@ +<%+cbi/valueheader%> + <% if self:cfgvalue(section) ~= false then %> + " style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> /> + <% else %> + - + <% end %> +<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_dvalue.htm b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_dvalue.htm new file mode 100644 index 0000000000..296c61e4d6 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_dvalue.htm @@ -0,0 +1,8 @@ +<%+cbi/valueheader%> + +<% + local val = self:cfgvalue(section) or self.default or "" + write(pcdata(val)) +%> + +<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_upload.htm b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_upload.htm new file mode 100644 index 0000000000..ceb518ee7e --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_upload.htm @@ -0,0 +1,5 @@ +<%+cbi/valueheader%> + + + +<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po b/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po new file mode 100644 index 0000000000..1ba67fcff4 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po @@ -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 \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/'" diff --git a/package/ctcgfw/luci-app-argon-config/root/etc/config/argon b/package/ctcgfw/luci-app-argon-config/root/etc/config/argon new file mode 100644 index 0000000000..11fb00f5b9 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/root/etc/config/argon @@ -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' \ No newline at end of file diff --git a/package/ctcgfw/luci-app-argon-config/root/etc/uci-defaults/luci-argon-config b/package/ctcgfw/luci-app-argon-config/root/etc/uci-defaults/luci-argon-config new file mode 100644 index 0000000000..935d7c8be5 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/root/etc/uci-defaults/luci-argon-config @@ -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 diff --git a/package/ctcgfw/luci-app-openclash/files/etc/openclash/game_rules.list b/package/ctcgfw/luci-app-openclash/files/etc/openclash/game_rules.list index 7ef328cdbf..7a87cbbcfa 100644 --- a/package/ctcgfw/luci-app-openclash/files/etc/openclash/game_rules.list +++ b/package/ctcgfw/luci-app-openclash/files/etc/openclash/game_rules.list @@ -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 \ No newline at end of file diff --git a/package/ctcgfw/luci-app-openclash/files/etc/openclash/rule_providers.list b/package/ctcgfw/luci-app-openclash/files/etc/openclash/rule_providers.list index 4faf1334b3..118f4124bd 100644 --- a/package/ctcgfw/luci-app-openclash/files/etc/openclash/rule_providers.list +++ b/package/ctcgfw/luci-app-openclash/files/etc/openclash/rule_providers.list @@ -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 \ No newline at end of file diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/rule-providers-manage.lua b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/rule-providers-manage.lua index 50dbdaa65c..df0f155b9d 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/rule-providers-manage.lua +++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/rule-providers-manage.lua @@ -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")) diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_chnroute.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_chnroute.sh old mode 100644 new mode 100755 diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_download_rule_list.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_download_rule_list.sh index ba9510315a..9b883eae5f 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_download_rule_list.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_download_rule_list.sh @@ -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 \ No newline at end of file diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_ps.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_ps.sh old mode 100644 new mode 100755 diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh index 5c226e2137..addd21bed3 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh @@ -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 diff --git a/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po b/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po index 87b78355c3..53e3c8a8f6 100644 --- a/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po +++ b/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po @@ -934,7 +934,7 @@ msgid "Order Number" msgstr "序号" msgid "Game Rules Manage" -msgstr "管理游戏规则" +msgstr "管理第三方游戏规则" msgid "Other Rule Provider Manage" msgstr "管理第三方规则集" diff --git a/package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua b/package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua index b040778d0a..4fc9995c90 100644 --- a/package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua +++ b/package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua @@ -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() diff --git a/package/ctcgfw/luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm b/package/ctcgfw/luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm index 37c7ec8695..6c319de5db 100644 --- a/package/ctcgfw/luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm +++ b/package/ctcgfw/luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm @@ -1,5 +1,5 @@