2022-04-11 14:15:32 +08:00
|
|
|
#!/bin/sh
|
|
|
|
time=$(TZ=UTC-8 date +'%Y-%m-%d %H:%M')
|
|
|
|
date=$(TZ=UTC-8 date +'%Y-%m-%d %H:%M:%S')(北京时间)
|
|
|
|
sed -i "s/! Version:.*/! Version: $time /g" rules-admin.txt url-filter.txt
|
|
|
|
sed -i "s/! Last Update:.*/! Last Update: $date /g" rules-admin.txt url-filter.txt
|
2022-05-20 20:30:44 +08:00
|
|
|
|
|
|
|
easylist=(
|
2022-05-20 20:38:46 +08:00
|
|
|
#"https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt"
|
2022-05-20 20:30:44 +08:00
|
|
|
"https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt"
|
|
|
|
"https://raw.githubusercontent.com/banbendalao/ADgk/master/ADgk.txt"
|
|
|
|
"https://easylist.to/easylist/easyprivacy.txt"
|
|
|
|
"https://filters.adtidy.org/windows/filters/224.txt"
|
|
|
|
"https://raw.githubusercontent.com/damengzhu/banad/main/jiekouAD.txt"
|
2022-05-20 20:38:46 +08:00
|
|
|
"https://github.com/Cats-Team/AdRules/blob/main/mod/rules/dns-rules.txt"
|
|
|
|
"https://github.com/Cats-Team/AdRules/blob/main/mod/rules/thrid-part-rules.txt"
|
|
|
|
"https://github.com/Cats-Team/AdRules/blob/main/mod/rules/adblock-rules.txt"
|
2022-05-20 20:30:44 +08:00
|
|
|
)
|
|
|
|
for i in "${!easylist[@]}"
|
|
|
|
do
|
|
|
|
echo "开始下载 easylist${i}..."
|
|
|
|
curl -k -o "./easylist${i}.txt" --connect-timeout 60 -s "${easylist[$i]}" &
|
|
|
|
# shellcheck disable=SC2181
|
|
|
|
if [ $? -ne 0 ];then
|
|
|
|
echo '下载失败,请重试'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
wait
|
|
|
|
|
2022-04-23 12:06:21 +08:00
|
|
|
cat rules-admin.txt | grep -E "^[(\@\@)|(\|\|)][^\/\^]+\^" | grep -Fv "$" |sort | uniq > dns.txt
|
2022-05-20 20:38:46 +08:00
|
|
|
counting=`cat easy* dns.txt | grep -E "^[(\@\@)|(\|\|)][^\/\^]+\^$" |sort | uniq |wc -l`
|
2022-05-20 20:45:50 +08:00
|
|
|
tittle="! Title: Quickly List \n ! Version: $time \n ! Last Update: $date \n ! Total count: $counting"
|
2022-05-20 20:41:35 +08:00
|
|
|
echo -e "$tittle" > dns-list.txt
|
2022-05-20 20:38:46 +08:00
|
|
|
cat easy* dns.txt | grep -E "^[(\@\@)|(\|\|)][^\/\^]+\^$" |sort | uniq >> dns-list.txt
|
2022-05-20 20:30:44 +08:00
|
|
|
rm -f easy*
|
2022-04-11 14:15:32 +08:00
|
|
|
exit
|