mirror of
https://github.com/privacy-protection-tools/anti-AD.git
synced 2025-02-02 11:43:00 +08:00
更新执行脚本,完善代码
This commit is contained in:
parent
cf4371c3a3
commit
2877c17bf5
8
start.sh
8
start.sh
@ -8,6 +8,7 @@ git pull
|
|||||||
echo '开始下载 easylist1...'
|
echo '开始下载 easylist1...'
|
||||||
wget -O ./origin-files/easylistchina+easylist.txt --timeout 30 https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt
|
wget -O ./origin-files/easylistchina+easylist.txt --timeout 30 https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt
|
||||||
|
|
||||||
|
# shellcheck disable=SC2181
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
echo '下载失败,请重试'
|
echo '下载失败,请重试'
|
||||||
exit 1
|
exit 1
|
||||||
@ -16,6 +17,7 @@ fi
|
|||||||
echo '开始下载 easylist2...'
|
echo '开始下载 easylist2...'
|
||||||
wget -O ./origin-files/cjx-annoyance.txt --timeout 30 https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt
|
wget -O ./origin-files/cjx-annoyance.txt --timeout 30 https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt
|
||||||
|
|
||||||
|
# shellcheck disable=SC2181
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
echo '下载失败,请重试'
|
echo '下载失败,请重试'
|
||||||
exit 1
|
exit 1
|
||||||
@ -24,6 +26,7 @@ fi
|
|||||||
echo '开始下载 easylist3...'
|
echo '开始下载 easylist3...'
|
||||||
wget -O ./origin-files/fanboy-annoyance.txt --timeout 30 https://easylist.to/easylist/fanboy-annoyance.txt
|
wget -O ./origin-files/fanboy-annoyance.txt --timeout 30 https://easylist.to/easylist/fanboy-annoyance.txt
|
||||||
|
|
||||||
|
# shellcheck disable=SC2181
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
echo '下载失败,请重试'
|
echo '下载失败,请重试'
|
||||||
exit 1
|
exit 1
|
||||||
@ -33,6 +36,7 @@ fi
|
|||||||
echo '开始下载 hosts1...'
|
echo '开始下载 hosts1...'
|
||||||
wget -O ./origin-files/hosts1 --timeout 30 https://hosts.nfz.moe/full/hosts
|
wget -O ./origin-files/hosts1 --timeout 30 https://hosts.nfz.moe/full/hosts
|
||||||
|
|
||||||
|
# shellcheck disable=SC2181
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
echo '下载失败,请重试'
|
echo '下载失败,请重试'
|
||||||
exit 1
|
exit 1
|
||||||
@ -41,6 +45,7 @@ fi
|
|||||||
echo '开始下载 hosts2...'
|
echo '开始下载 hosts2...'
|
||||||
wget -O ./origin-files/hosts2 --timeout 60 https://raw.githubusercontent.com/vokins/yhosts/master/hosts
|
wget -O ./origin-files/hosts2 --timeout 60 https://raw.githubusercontent.com/vokins/yhosts/master/hosts
|
||||||
|
|
||||||
|
# shellcheck disable=SC2181
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
echo '下载失败,请重试'
|
echo '下载失败,请重试'
|
||||||
exit 1
|
exit 1
|
||||||
@ -49,6 +54,7 @@ fi
|
|||||||
echo '开始下载 hosts3...'
|
echo '开始下载 hosts3...'
|
||||||
wget -O ./origin-files/hosts3 --timeout 60 https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts
|
wget -O ./origin-files/hosts3 --timeout 60 https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts
|
||||||
|
|
||||||
|
# shellcheck disable=SC2181
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
echo '下载失败,请重试'
|
echo '下载失败,请重试'
|
||||||
exit 1
|
exit 1
|
||||||
@ -57,6 +63,6 @@ fi
|
|||||||
|
|
||||||
PHP_RET=$(/usr/local/php/bin/php make-addr.php)
|
PHP_RET=$(/usr/local/php/bin/php make-addr.php)
|
||||||
|
|
||||||
git add -A adblock-for-dnsmasq.conf hosts1 hosts2 host3 *.txt
|
git add -A adblock-for-dnsmasq.conf origin-files/*
|
||||||
git commit -am "auto commit. script output--- $PHP_RET"
|
git commit -am "auto commit. script output--- $PHP_RET"
|
||||||
git push --force
|
git push --force
|
||||||
|
@ -79,5 +79,5 @@ while(!feof($src_fp)){
|
|||||||
|
|
||||||
//删除之前验证工具生成的中间结果
|
//删除之前验证工具生成的中间结果
|
||||||
foreach(array_merge($china_list_files, $dead_horse_files) as $f){
|
foreach(array_merge($china_list_files, $dead_horse_files) as $f){
|
||||||
// unlink($f);
|
unlink($f);
|
||||||
}
|
}
|
||||||
|
7
tools/start-research.sh
Executable file
7
tools/start-research.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#每周运行一次
|
||||||
|
|
||||||
|
source /etc/profile
|
||||||
|
cd $(cd "$(dirname "$0")";pwd)
|
||||||
|
|
||||||
|
nohup php research-addr.php >> ./std-research.out &
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#每天运行一次
|
||||||
|
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
cd $(cd "$(dirname "$0")";pwd)
|
cd $(cd "$(dirname "$0")";pwd)
|
Loading…
Reference in New Issue
Block a user