From ab44085b94f6137d57bf4ff8f8603d0df4457589 Mon Sep 17 00:00:00 2001 From: gently <1243610+gentlyxu@users.noreply.github.com> Date: Sun, 19 Jan 2020 16:33:43 +0800 Subject: [PATCH] merge start.sh & start-ci.sh --- start.sh | 113 ++----------------------------------------------------- 1 file changed, 3 insertions(+), 110 deletions(-) diff --git a/start.sh b/start.sh index 9e67d22c..f518e49d 100755 --- a/start.sh +++ b/start.sh @@ -5,117 +5,10 @@ source /etc/profile cd $(cd "$(dirname "$0")";pwd) git pull -echo '开始下载 easylist1...' -curl -o ./origin-files/easylist1.txt --connect-timeout 60 \ - -s \ -https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt +shopt -s expand_aliases +alias php='/usr/local/php/bin/php' +. ./start-ci.sh -# shellcheck disable=SC2181 -if [ $? -ne 0 ];then - echo '下载失败,请重试' - exit 1 -fi - -echo '开始下载 easylist2...' -curl -o ./origin-files/easylist2.txt --connect-timeout 60 \ - -s \ -https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt - -# shellcheck disable=SC2181 -if [ $? -ne 0 ];then - echo '下载失败,请重试' - exit 1 -fi - -echo '开始下载 easylist3...' -curl -o ./origin-files/easylist3.txt --connect-timeout 60 \ - -s \ -https://easylist.to/easylist/fanboy-annoyance.txt - -# shellcheck disable=SC2181 -if [ $? -ne 0 ];then - echo '下载失败,请重试' - exit 1 -fi - - -echo '开始下载 easylist4...' -curl -o ./origin-files/easylist4.txt --connect-timeout 60 \ - -s \ -https://easylist.to/easylist/easyprivacy.txt - -# shellcheck disable=SC2181 -if [ $? -ne 0 ];then - echo '下载失败,请重试' - exit 1 -fi - - -echo '开始下载 hosts1...' -curl -o ./origin-files/hosts1 --connect-timeout 60 \ - -s \ - https://raw.githubusercontent.com/neoFelhz/neohosts/gh-pages/full/hosts.txt - -# shellcheck disable=SC2181 -if [ $? -ne 0 ];then - echo '下载失败,请重试' - exit 1 -fi - -echo '开始下载 hosts2...' -curl -o ./origin-files/hosts2 --connect-timeout 60 \ - -s \ - https://raw.githubusercontent.com/vokins/yhosts/master/hosts - -# shellcheck disable=SC2181 -if [ $? -ne 0 ];then - echo '下载失败,请重试' - exit 1 -fi - -echo '开始下载 hosts3...' -curl -o ./origin-files/hosts3 --connect-timeout 60 \ - -s \ - https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts - -# shellcheck disable=SC2181 -if [ $? -ne 0 ];then - echo '下载失败,请重试' - exit 1 -fi - -echo '开始下载 strict-hosts1...' -curl -o ./origin-files/strict-hosts1 --connect-timeout 60 \ - -s \ - https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt - -# shellcheck disable=SC2181 -if [ $? -ne 0 ];then - echo '下载失败,请重试' - exit 1 -fi - -cd origin-files - -cat hosts* | grep -v -E "^((#.*)|(\s*))$" \ - | grep -v -E "^[0-9\.:]+\s+(ip6\-)?(localhost|loopback)$" \ - | sed s/0.0.0.0/127.0.0.1/g | sed s/::/127.0.0.1/g | sort \ - | uniq >base-src-hosts.txt - -cat strict-hosts* | grep -v -E "^((#.*)|(\s*))$" \ - | grep -v -E "^[0-9\.:]+\s+(ip6\-)?(localhost|loopback)$" \ - | sed s/0.0.0.0/127.0.0.1/g | sed s/::/127.0.0.1/g | sort \ - | uniq >base-src-strict-hosts.txt - - -cat easylist*.txt | grep -E "^\|\|[^\*\^]+?\^" | sort | uniq >base-src-easylist.txt -cat easylist*.txt | grep -E "^\|\|?[^\^=\/:]+?\*[^\^=\/:]+?\^" | sort | uniq >wildcard-src-easylist.txt -cat easylist*.txt | grep -E "^@@\|\|?[^\^=\/:]+?\^[^\/=\*]+?$" | sort | uniq >whiterule-src-easylist.txt - -cd ../ - -PHP_RET=$(/usr/local/php/bin/php make-addr.php) -/usr/local/php/bin/php tools/easylist-extend.php anti-ad-easylist.txt git add -A adblock-for-dnsmasq.conf origin-files/* git commit -am "auto commit. script output--- $PHP_RET" git push --force