diff --git a/rules/auto_update/.gitignore b/rules/auto_update/.gitignore new file mode 100644 index 00000000..1d5b5a0d --- /dev/null +++ b/rules/auto_update/.gitignore @@ -0,0 +1,14 @@ +accelerated-domains.china.conf +apnic.txt +apple.china.conf +cdn1.txt +cdn_download.txt +chnroute1.txt +gfwlist1.conf +gfwlist_download.conf +gfwlist_download_tmp.conf +google.china.conf +Routing.txt +WhiteList.txt +WhiteList_new.txt +WhiteList_tmp.txt diff --git a/rules/auto_update/update_rules.sh b/rules/auto_update/update_rules.sh index 366f9c01..952f0f89 100755 --- a/rules/auto_update/update_rules.sh +++ b/rules/auto_update/update_rules.sh @@ -4,9 +4,11 @@ CurrentDate=`date +%Y-%m-%d` # get gfwlist for shadowsocks ipset mode ./fwlist.py gfwlist_download.conf +grep -Ev "([0-9]{1,3}[\.]){3}[0-9]{1,3}" gfwlist_download.conf > gfwlist_download_tmp.conf + if [ -f "gfwlist_download.conf" ];then - cat gfwlist_download.conf gfwlist_koolshare.conf | grep -Ev "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | sed "s/^/server=&\/./g" | sed "s/$/\/127.0.0.1#7913/g" > gfwlist_merge.conf - cat gfwlist_download.conf gfwlist_koolshare.conf | sed "s/^/ipset=&\/./g" | sed "s/$/\/gfwlist/g" >> gfwlist_merge.conf + cat gfwlist_download_tmp.conf gfwlist_koolshare.conf | grep -Ev "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | sed "s/^/server=&\/./g" | sed "s/$/\/127.0.0.1#7913/g" > gfwlist_merge.conf + cat gfwlist_download_tmp.conf gfwlist_koolshare.conf | sed "s/^/ipset=&\/./g" | sed "s/$/\/gfwlist/g" >> gfwlist_merge.conf fi sort -k 2 -t. -u gfwlist_merge.conf > gfwlist1.conf @@ -153,8 +155,8 @@ fi echo ================= # ====================================== -rm -rf google.china.conf -rm -rf apple.china.conf -rm gfwlist1.conf gfwlist_download.conf chnroute1.txt +rm google.china.conf +rm apple.china.conf +rm gfwlist1.conf gfwlist_download.conf gfwlist_download_tmp.conf chnroute1.txt rm cdn1.txt accelerated-domains.china.conf cdn_download.txt rm WhiteList.txt WhiteList_tmp.txt apnic.txt WhiteList_new.txt Routing.txt