Skip to content

Commit

Permalink
update rule update
Browse files Browse the repository at this point in the history
  • Loading branch information
hq450 committed Jan 24, 2019
1 parent ed7a6aa commit 826bd83
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
14 changes: 14 additions & 0 deletions rules/auto_update/.gitignore
Original file line number Diff line number Diff line change
@@ -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
12 changes: 7 additions & 5 deletions rules/auto_update/update_rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 826bd83

Please sign in to comment.