geoip-geosite-with-ru-block.../generate.sh

28 lines
1.3 KiB
Bash
Raw Normal View History

2023-11-11 19:49:22 +03:00
#!/bin/bash
set -euxo pipefail
mkdir -p .temp/result
[ ! -d .temp/az ] && \
git clone --depth=1 https://bitbucket.org/anticensority/antizapret-pac-generator-light.git .temp/az && \
cd .temp/az && \
patch < ../../data/az-cyrillic-idn-fix.patch && \
bash update.sh && \
bash parse.sh && \
cd ../..
[ ! -d .temp/geoip ] && \
git clone --depth=1 https://github.com/v2fly/geoip.git .temp/geoip && \
cat data/geoip-generator-config.json > .temp/geoip/config.json && \
cd .temp/geoip && \
([ ! -f geoip-src.dat ] && curl -fsSL https://github.com/v2fly/geoip/releases/latest/download/geoip.dat -o geoip-src.dat) && \
mkdir -p data && \
cp ../az/result/iplist_all.txt data/ru-blocked-ips-all && \
cp ../az/result/iplist_blockedbyip.txt data/ru-blocked-ips-directblock && \
cp ../az/result/iplist_blockedbyip_noid2971.txt data/ru-blocked-ips-noid2971 && \
go run ./ && \
mv output/dat/geoip.dat ../result/ && \
cd ../..
[ ! -d .temp/geosite ] && \
git clone --depth=1 https://github.com/v2fly/domain-list-community.git .temp/geosite && \
cd .temp/geosite && \
cp ../az/result/hostlist_zones.txt data/category-ru-blocked-zones && \
cp ../az/result/hostlist_original.txt data/category-ru-blocked-domains && \
go run ./ --outputdir=../result --outputname=geosite.dat