From 1966f6dbd6748a7df29be03bb5aa2b13543b0373 Mon Sep 17 00:00:00 2001 From: MkQtS <81752398+MkQtS@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:17:58 +0800 Subject: [PATCH] remove useless entrys --- scripts/origin-files/upstream-hosts.txt | 2 -- ...st.txt => upstream-whiterule-easylist.txt} | 0 ...ist.txt => upstream-wildcard-easylist.txt} | 0 scripts/origin-files/yhosts-latest.txt | 1 - scripts/prepare-upstream.sh | 20 +++++++++---------- 5 files changed, 10 insertions(+), 13 deletions(-) rename scripts/origin-files/{upstream-whiterule-src-easylist.txt => upstream-whiterule-easylist.txt} (100%) rename scripts/origin-files/{upstream-wildcard-src-easylist.txt => upstream-wildcard-easylist.txt} (100%) diff --git a/scripts/origin-files/upstream-hosts.txt b/scripts/origin-files/upstream-hosts.txt index c06c0415..0b520a51 100644 --- a/scripts/origin-files/upstream-hosts.txt +++ b/scripts/origin-files/upstream-hosts.txt @@ -13486,5 +13486,3 @@ 127.0.0.1 zzy.mipujia.com 127.0.0.1 zzy.quyaoya.com 127.0.0.1 zzy1.mipujia.com -13.107.21.200 cn.bing.com -255.255.255.255 broadcasthost diff --git a/scripts/origin-files/upstream-whiterule-src-easylist.txt b/scripts/origin-files/upstream-whiterule-easylist.txt similarity index 100% rename from scripts/origin-files/upstream-whiterule-src-easylist.txt rename to scripts/origin-files/upstream-whiterule-easylist.txt diff --git a/scripts/origin-files/upstream-wildcard-src-easylist.txt b/scripts/origin-files/upstream-wildcard-easylist.txt similarity index 100% rename from scripts/origin-files/upstream-wildcard-src-easylist.txt rename to scripts/origin-files/upstream-wildcard-easylist.txt diff --git a/scripts/origin-files/yhosts-latest.txt b/scripts/origin-files/yhosts-latest.txt index 7f44925d..f9bb6826 100644 --- a/scripts/origin-files/yhosts-latest.txt +++ b/scripts/origin-files/yhosts-latest.txt @@ -1090,7 +1090,6 @@ 127.0.0.1 www.2144.cn 127.0.0.1 iadctest.qwapi.com 127.0.0.1 ieonline.microsoft.com -13.107.21.200 cn.bing.com 127.0.0.1 dl.2345.com 127.0.0.1 download.2345.com 127.0.0.1 g.wan.2345.com diff --git a/scripts/prepare-upstream.sh b/scripts/prepare-upstream.sh index c2773cb7..c32b40c5 100755 --- a/scripts/prepare-upstream.sh +++ b/scripts/prepare-upstream.sh @@ -77,18 +77,18 @@ echo "$upstreamHead" >./origin-files/upstream-hosts.txt echo "$upstreamHead" >./origin-files/upstream-strict-hosts.txt echo "$upstreamHead" >./origin-files/upstream-dead-hosts.txt echo "$upstreamHead" >./origin-files/upstream-easylist.txt -echo "$upstreamHead" >./origin-files/upstream-wildcard-src-easylist.txt -echo "$upstreamHead" >./origin-files/upstream-whiterule-src-easylist.txt +echo "$upstreamHead" >./origin-files/upstream-wildcard-easylist.txt +echo "$upstreamHead" >./origin-files/upstream-whiterule-easylist.txt for listfile in ./raw-sources/hosts*; do echo "# $listfile" >>./origin-files/upstream-hosts.txt - tr -d '\r' <"$listfile" | grep -v -E "^((#.*)|(\s*))$" | grep -v -E "^[0-9\.:]+\s+(ip6\-)?(localhost|loopback)$" | + tr -d '\r' <"$listfile" | grep -v -E "^((#.*)|(\s*))$" | grep -v -E "^[0-9\.:]+\s+(ip6\-)?(broadcasthost|localhost|loopback)$" | sed -e 's/0.0.0.0/127.0.0.1/g' -e 's/::/127.0.0.1/g' | sort -u >>./origin-files/upstream-hosts.txt done for listfile in ./raw-sources/strict-hosts*; do echo "# $listfile" >>./origin-files/upstream-strict-hosts.txt - tr -d '\r' <"$listfile" | grep -v -E "^((#.*)|(\s*))$" | grep -v -E "^[0-9\.:]+\s+(ip6\-)?(localhost|loopback)$" | + tr -d '\r' <"$listfile" | grep -v -E "^((#.*)|(\s*))$" | grep -v -E "^[0-9\.:]+\s+(ip6\-)?(broadcasthost|localhost|loopback)$" | sed -e 's/0.0.0.0/127.0.0.1/g' -e 's/::/127.0.0.1/g' | sort -u >>./origin-files/upstream-strict-hosts.txt done @@ -101,11 +101,11 @@ for listfile in ./raw-sources/easylist*; do echo "# $listfile" >>./origin-files/upstream-easylist.txt tr -d '\r' <"$listfile" | grep -E "^\|\|[^\*\^]+?\^" | sort -u >>./origin-files/upstream-easylist.txt - echo "# $listfile" >>./origin-files/upstream-wildcard-src-easylist.txt - tr -d '\r' <"$listfile" | grep -E "^\|\|?([^\^=\/:]+)?\*([^\^=\/:]+)?\^" | sort -u >>./origin-files/upstream-wildcard-src-easylist.txt + echo "# $listfile" >>./origin-files/upstream-wildcard-easylist.txt + tr -d '\r' <"$listfile" | grep -E "^\|\|?([^\^=\/:]+)?\*([^\^=\/:]+)?\^" | sort -u >>./origin-files/upstream-wildcard-easylist.txt - echo "# $listfile" >>./origin-files/upstream-whiterule-src-easylist.txt - tr -d '\r' <"$listfile" | grep -E "^@@\|\|?[^\^=\/:]+?\^([^\/=\*]+)?$" | sort -u >>./origin-files/upstream-whiterule-src-easylist.txt + echo "# $listfile" >>./origin-files/upstream-whiterule-easylist.txt + tr -d '\r' <"$listfile" | grep -E "^@@\|\|?[^\^=\/:]+?\^([^\/=\*]+)?$" | sort -u >>./origin-files/upstream-whiterule-easylist.txt done rm -r ./raw-sources @@ -114,7 +114,7 @@ sed '/^#/d' ./origin-files/upstream-hosts.txt | sort -u >./origin-files/base-src sed '/^#/d' ./origin-files/upstream-strict-hosts.txt | sort -u >./origin-files/base-src-strict-hosts.txt sed '/^#/d' ./origin-files/upstream-dead-hosts.txt | sort -u >./origin-files/base-dead-hosts.txt sed '/^#/d' ./origin-files/upstream-easylist.txt | sort -u >./origin-files/base-src-easylist.txt -sed '/^#/d' ./origin-files/upstream-wildcard-src-easylist.txt | sort -u >./origin-files/wildcard-src-easylist.txt -sed '/^#/d' ./origin-files/upstream-whiterule-src-easylist.txt | sort -u >./origin-files/whiterule-src-easylist.txt +sed '/^#/d' ./origin-files/upstream-wildcard-easylist.txt | sort -u >./origin-files/wildcard-src-easylist.txt +sed '/^#/d' ./origin-files/upstream-whiterule-easylist.txt | sort -u >./origin-files/whiterule-src-easylist.txt cd ../