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_Hans/openclash.zh-cn.po b/package/ctcgfw/luci-app-openclash/i18n/zh_Hans/openclash.zh-cn.po index 3361b5350e..a3e96a28aa 100644 --- a/package/ctcgfw/luci-app-openclash/i18n/zh_Hans/openclash.zh-cn.po +++ b/package/ctcgfw/luci-app-openclash/i18n/zh_Hans/openclash.zh-cn.po @@ -934,7 +934,7 @@ msgid "Order Number" msgstr "序号" msgid "Game Rules Manage" -msgstr "管理游戏规则" +msgstr "管理第三方游戏规则" msgid "Other Rule Provider Manage" msgstr "管理第三方规则集"