-
Notifications
You must be signed in to change notification settings - Fork 0
/
antifilter.sh
34 lines (26 loc) · 1.29 KB
/
antifilter.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
DIR="/var/www"
# Download antifilter list
curl -s -o ${DIR}/allyouneed.lst https://antifilter.download/list/allyouneed.lst
# Download antifilter community geoip list
curl -s -o ${DIR}/community.lst https://community.antifilter.download/list/community.lst
# Download antifilter community geosite list
curl -s -o ${DIR}/data/antifilter-community-domain https://community.antifilter.download/list/domains.lst
### Modify for Shadowrocket & Clash ###
# Shadowrocket
sed -e 's/^/IP-CIDR,/' ${DIR}/allyouneed.lst > ${DIR}/antifilter-ip.list
sed -e 's/^/IP-CIDR,/' ${DIR}/community.lst > ${DIR}/antifilter-community-ip.list
sed -e 's/^/DOMAIN-SUFFIX,/' ${DIR}/data/antifilter-community-domain > ${DIR}/antifilter-community-domain.list
# Clash
sed -e 's/^/ - /' ${DIR}/antifilter-ip.list > ${DIR}/antifilter-ip.yaml
sed -i '1 i\payload:' ${DIR}/antifilter-ip.yaml
sed -e 's/^/ - /' ${DIR}/antifilter-community-ip.list > ${DIR}/antifilter-community-ip.yaml
sed -i '1 i\payload:' ${DIR}/antifilter-community-ip.yaml
sed -e 's/^/ - /' ${DIR}/antifilter-community-domain.list > ${DIR}/antifilter-community-domain.yaml
sed -i '1 i\payload:' ${DIR}/antifilter-community-domain.yaml
# chown
chown abc:abc ${DIR}/antifilter-*.{list,yaml}
# Generate geoip.dat
/srv/geoip.sh
# Generate geosite.dat
/srv/geosite.sh