11#! /bin/bash
2-
3- # FOP - Filter Orderer and Preener (Phyton Edition)
4- # python tools/FOP.py
5- # FOP - Filter Orderer and Preener (Rust Edition)
6- fop -n src/
7-
8- # render it and save it into
9- flrender -i abpindo=. abpindo.template subscriptions/abpindo.txt
10- flrender -i abpindo=. abpindo_extended.template subscriptions/abpindo_extended.txt
11- flrender -i abpindo=. abpindo_annoyances.template subscriptions/abpindo_annoyances.txt
12- flrender -i abpindo=. abpindo_hosts.template subscriptions/abpindo_hosts.txt
13- flrender -i abpindo=. abpindo_hosts_adult.template subscriptions/abpindo_hosts_adult.txt
14- flrender -i abpindo=. abpindo_noadult.template subscriptions/abpindo_noadult.txt
15- flrender -i abpindo=. abpindo_noelemhide.template subscriptions/abpindo_noelemhide.txt
16-
17- adblock2hosts --ip 0.0.0.0 -o subscriptions/hosts.txt subscriptions/abpindo_hosts .txt
18- adblock2hosts --ip 0.0.0.0 -o subscriptions/hosts_adult.txt subscriptions/abpindo_hosts_adult .txt
19-
20- adblock2plain -o subscriptions/domain.txt subscriptions/abpindo_hosts .txt
21- adblock2plain -o subscriptions/domain_adult.txt subscriptions/abpindo_hosts_adult .txt
22-
23- adblock2plain -o tools/domain_plain.txt subscriptions/abpindo .txt
24- adblock2plain --aggressive -o tools/domain_plain_aggressive.txt subscriptions/abpindo.txt
25-
26- python tools/hosts_to_dnsmasq_address.py subscriptions /hosts.txt subscriptions/dnsmasq .txt
27- python tools/hosts_to_dnsmasq_address.py subscriptions /hosts_adult.txt subscriptions/dnsmasq_adult .txt
28- python tools/hosts_to_dnsmasq_server.py subscriptions/hosts.txt subscriptions/dnsmasq_server.txt
29- python tools/hosts_to_dnsmasq_server.py subscriptions/hosts_adult .txt subscriptions/dnsmasq_adult_server .txt
30-
31- python tools/hosts_to_rpz.py subscriptions/hosts.txt subscriptions/rpz.txt
32- python tools/hosts_to_rpz .py subscriptions/hosts_adult .txt subscriptions/rpz_adult .txt
33-
34- python tools/hosts_to_aghome .py subscriptions /hosts.txt subscriptions/aghome .txt
35- python tools/hosts_to_aghome .py subscriptions /hosts_adult.txt subscriptions/aghome_adult .txt
36-
37- python tools/hosts_to_unbound .py subscriptions/hosts .txt subscriptions/unbound .txt
38- python tools/hosts_to_unbound .py subscriptions/hosts_adult .txt subscriptions/unbound_adult .txt
39-
40- # adblock2hosts -o subscriptions/domain .txt subscriptions/abpindo_hosts .txt
41- # adblock2hosts -o subscriptions/domain_adult .txt subscriptions/abpindo_hosts_adult .txt
42-
43- read -p " Press any key to resume ... "
2+ # build.sh — Local development build script.
3+ # For CI/CD, use .github/workflows/autobuild.yml instead.
4+
5+ set -euo pipefail
6+
7+ REPO_ROOT= " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
8+ SUBSCRIPTIONS= " $REPO_ROOT /subscriptions "
9+ TOOLS= " $REPO_ROOT /tools "
10+
11+ mkdir -p " $SUBSCRIPTIONS "
12+
13+ echo " ==> Running FOP... "
14+ fop -n " $REPO_ROOT /src/ "
15+
16+ echo " ==> Building ABP subscriptions... "
17+ flrender -i abpindo= " $REPO_ROOT " " $REPO_ROOT /abpindo.template " " $SUBSCRIPTIONS /abpindo .txt"
18+ flrender -i abpindo= " $REPO_ROOT " " $REPO_ROOT /abpindo_noadult.template " " $SUBSCRIPTIONS /abpindo_noadult .txt"
19+ flrender -i abpindo= " $REPO_ROOT " " $REPO_ROOT /abpindo_noelemhide.template " " $SUBSCRIPTIONS /abpindo_noelemhide.txt "
20+ flrender -i abpindo= " $REPO_ROOT " " $REPO_ROOT /abpindo_annoyances.template " " $SUBSCRIPTIONS /abpindo_annoyances .txt"
21+ flrender -i abpindo= " $REPO_ROOT " " $REPO_ROOT /abpindo_extended.template " " $SUBSCRIPTIONS /abpindo_extended .txt"
22+ flrender -i abpindo= " $REPO_ROOT " " $REPO_ROOT /abpindo_hosts.template " " $SUBSCRIPTIONS /abpindo_hosts.txt "
23+ flrender -i abpindo= " $REPO_ROOT " " $REPO_ROOT /abpindo_hosts_adult.template " " $SUBSCRIPTIONS /abpindo_hosts_adult .txt"
24+
25+ echo " ==> Building DNS filters... "
26+ adblock2hosts --ip 0.0.0.0 -o " $SUBSCRIPTIONS /hosts.txt" " $SUBSCRIPTIONS /abpindo_hosts .txt"
27+ adblock2hosts --ip 0.0.0.0 -o " $SUBSCRIPTIONS /hosts_adult.txt" " $SUBSCRIPTIONS /abpindo_hosts_adult .txt"
28+
29+ adblock2plain -o " $SUBSCRIPTIONS /domain .txt" " $SUBSCRIPTIONS /abpindo_hosts .txt"
30+ adblock2plain -o " $SUBSCRIPTIONS /domain_adult.txt " " $SUBSCRIPTIONS /abpindo_hosts_adult.txt "
31+
32+ python3 " $TOOLS /dns_converter .py" --format dnsmasq_address " $SUBSCRIPTIONS /hosts .txt" " $SUBSCRIPTIONS /dnsmasq .txt"
33+ python3 " $TOOLS /dns_converter.py " --format dnsmasq_address " $SUBSCRIPTIONS /hosts_adult.txt " " $SUBSCRIPTIONS /dnsmasq_adult.txt "
34+ python3 " $TOOLS /dns_converter .py" --format dnsmasq_server " $SUBSCRIPTIONS /hosts.txt" " $SUBSCRIPTIONS /dnsmasq_server .txt"
35+ python3 " $TOOLS /dns_converter .py" --format dnsmasq_server " $SUBSCRIPTIONS /hosts_adult.txt" " $SUBSCRIPTIONS /dnsmasq_adult_server .txt"
36+ python3 " $TOOLS /dns_converter.py " --format rpz " $SUBSCRIPTIONS /hosts.txt " " $SUBSCRIPTIONS /rpz.txt "
37+ python3 " $TOOLS /dns_converter .py" --format rpz " $SUBSCRIPTIONS /hosts_adult .txt" " $SUBSCRIPTIONS /rpz_adult .txt"
38+ python3 " $TOOLS /dns_converter .py" --format aghome " $SUBSCRIPTIONS /hosts .txt" " $SUBSCRIPTIONS /aghome .txt"
39+ python3 " $TOOLS /dns_converter.py " --format aghome " $SUBSCRIPTIONS /hosts_adult.txt " " $SUBSCRIPTIONS /aghome_adult.txt "
40+ python3 " $TOOLS /dns_converter.py " --format unbound " $SUBSCRIPTIONS /hosts .txt" " $SUBSCRIPTIONS /unbound .txt"
41+ python3 " $TOOLS /dns_converter.py " --format unbound " $SUBSCRIPTIONS /hosts_adult .txt" " $SUBSCRIPTIONS /unbound_adult .txt"
42+
43+ echo " ==> Done. Output: $SUBSCRIPTIONS / "
0 commit comments