Skip to content

Commit

Permalink
工作流:从AdGuardHome-Rules仓库获取上游 DNS 服务器分流规则
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed Nov 4, 2023
1 parent d865af0 commit 7d2771c
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions .github/workflows/build-openwrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -585,24 +585,7 @@ jobs:
cd $WORKSPACE_ROOT_PATH/tmp
ls
rm -rf *
curl -s -L --retry 6 https://raw.githubusercontent.com/YW5vbnltb3Vz/domain-list-community/release/gfwlist.txt -o base64_YW5vbnltb3Vz.txt
curl -s -L --retry 6 https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt -o Loyalsoldier.txt
curl -s -L --retry 6 https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt -o base64_gfwlist.txt
curl -s -L --retry 6 https://raw.githubusercontent.com/Loukky/gfwlist-by-loukky/master/gfwlist.txt -o base64_Loukky.txt
base64 -d base64_YW5vbnltb3Vz.txt > YW5vbnltb3Vz.txt
base64 -d base64_gfwlist.txt > gfwlist.txt
base64 -d base64_Loukky.txt > Loukky.txt
sed -e '/^!/d' -e '/^\\/d' -e '/^@/d' -e 's/|//g' -e '/^http:\/\//d' -e '/^https:\/\//d' -e '/\//d' -e 's/^\.//g' -e '/\./!d' -e '/ /d' -e '/\*/d' -e '/%/d' -e '/^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/d' YW5vbnltb3Vz.txt>> gfwlist_chen
sed -e '/^!/d' -e '/^\\/d' -e '/^@/d' -e 's/|//g' -e '/^http:\/\//d' -e '/^https:\/\//d' -e '/\//d' -e 's/^\.//g' -e '/\./!d' -e '/ /d' -e '/\*/d' -e '/%/d' -e '/^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/d' Loyalsoldier.txt>> gfwlist_chen
sed -e '/^!/d' -e '/^\\/d' -e '/^@/d' -e 's/|//g' -e '/^http:\/\//d' -e '/^https:\/\//d' -e '/\//d' -e 's/^\.//g' -e '/\./!d' -e '/ /d' -e '/\*/d' -e '/%/d' -e '/^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/d' gfwlist.txt>> gfwlist_chen
sed -e '/^!/d' -e '/^\\/d' -e '/^@/d' -e 's/|//g' -e '/^http:\/\//d' -e '/^https:\/\//d' -e '/\//d' -e 's/^\.//g' -e '/\./!d' -e '/ /d' -e '/\*/d' -e '/%/d' -e '/^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/d' Loukky.txt>> gfwlist_chen
sort gfwlist_chen | uniq > gfwlist
sed -n '/^ - DOMAIN,/p' $OPENWRT_ROOT_PATH/files/etc/openclash/rule_provider/DirectRule-chenmozhijin.yaml|sed -e "s/^ - DOMAIN,/[\//g" -e 's/$/\/]127.0.0.1:6053/g' >> ./AdGuardHomednslist
sed -n '/^ - DOMAIN-SUFFIX,/p' $OPENWRT_ROOT_PATH/files/etc/openclash/rule_provider/DirectRule-chenmozhijin.yaml|sed -e "s/^ - DOMAIN-SUFFIX,/[\//g" -e 's/$/\/]127.0.0.1:6053/g' >> ./AdGuardHomednslist
sed -n '/^ - DOMAIN,/p' $OPENWRT_ROOT_PATH/files/etc/openclash/rule_provider/ProxyRule-chenmozhijin.yaml|sed -e "s/^ - DOMAIN,/[\//g" -e 's/$/\/]127.0.0.1:5335/g' >> ./AdGuardHomednslist
sed -n '/^ - DOMAIN-SUFFIX,/p' $OPENWRT_ROOT_PATH/files/etc/openclash/rule_provider/ProxyRule-chenmozhijin.yaml|sed -e "s/^ - DOMAIN-SUFFIX,/[\//g" -e 's/$/\/]127.0.0.1:5335/g' >> ./AdGuardHomednslist
sed -e 's/^/[\//g' -e 's/$/\/]127.0.0.1:5335/g' gfwlist >AdGuardHomednslist
sed -i "s/ //g" ./AdGuardHomednslist
curl -s -L --retry 6 --connect-timeout 20 "https://raw.githubusercontent.com/chenmozhijin/AdGuardHome-Rules/main/AdGuardHome-dnslist(by%20cmzj).yaml" -o "AdGuardHomednslist"
cat ./AdGuardHomednslist >> $OPENWRT_ROOT_PATH/files/etc/AdGuardHome-dnslist"(by cmzj)".yaml
echo "AdGuardHome-dnslist(by cmzj).yaml" >> $LOG_PATH/AdGuardHome.log
cat $OPENWRT_ROOT_PATH/files/etc/AdGuardHome-dnslist"(by cmzj)".yaml >> $LOG_PATH/AdGuardHome.log
Expand Down

0 comments on commit 7d2771c

Please sign in to comment.