2 SMARTDNS_SPEEDTEST_MODE
=ping
,tcp
:80
7 sed
-e
's|^server=/\(.*\)/114.114.114.114$$|\1|' accelerated-domains.china.conf | grep
-Ev
-e
'^#' -e
'^$$' > accelerated-domains.china.raw.txt
8 sed
-e
's|^server=/\(.*\)/114.114.114.114$$|\1|' google.china.conf | grep
-Ev
-e
'^#' -e
'^$$' > google.china.raw.txt
9 sed
-e
's|^server=/\(.*\)/114.114.114.114$$|\1|' apple.china.conf | grep
-Ev
-e
'^#' -e
'^$$' > apple.china.raw.txt
12 sed
-e
's|\(.*\)|server=/\1/$(SERVER)|' accelerated-domains.china.raw.txt
> accelerated-domains.china.dnsmasq.conf
13 sed
-e
's|\(.*\)|server=/\1/$(SERVER)|' google.china.raw.txt
> google.china.dnsmasq.conf
14 sed
-e
's|\(.*\)|server=/\1/$(SERVER)|' apple.china.raw.txt
> apple.china.dnsmasq.conf
17 sed
-e
"s|\(.*\)|\1 {\n forward . $(SERVER)\n}|" accelerated-domains.china.raw.txt
> accelerated-domains.china.coredns.conf
18 sed
-e
"s|\(.*\)|\1 {\n forward . $(SERVER)\n}|" google.china.raw.txt
> google.china.coredns.conf
19 sed
-e
"s|\(.*\)|\1 {\n forward . $(SERVER)\n}|" apple.china.raw.txt
> apple.china.coredns.conf
22 sed
-e
"s|\(.*\)|nameserver /\1/$(SERVER)|" accelerated-domains.china.raw.txt
> accelerated-domains.china.smartdns.conf
23 sed
-e
"s|\(.*\)|nameserver /\1/$(SERVER)|" google.china.raw.txt
> google.china.smartdns.conf
24 sed
-e
"s|\(.*\)|nameserver /\1/$(SERVER)|" apple.china.raw.txt
> apple.china.smartdns.conf
25 sed
-e
"s|=| |" bogus-nxdomain.china.conf
> bogus-nxdomain.china.smartdns.conf
27 smartdns-domain-rules
: raw
28 sed
-e
"s|\(.*\)|domain-rules /\1/ -speed-check-mode $(SMARTDNS_SPEEDTEST_MODE) -nameserver $(SERVER)|" accelerated-domains.china.raw.txt
> accelerated-domains.china.domain.smartdns.conf
29 sed
-e
"s|\(.*\)|domain-rules /\1/ -speed-check-mode $(SMARTDNS_SPEEDTEST_MODE) -nameserver $(SERVER)|" google.china.raw.txt
> google.china.domain.smartdns.conf
30 sed
-e
"s|\(.*\)|domain-rules /\1/ -speed-check-mode $(SMARTDNS_SPEEDTEST_MODE) -nameserver $(SERVER)|" apple.china.raw.txt
> apple.china.domain.smartdns.conf
33 sed
-e
's|\(.*\)|forward-zone:\n name: "\1."\n forward-addr: $(SERVER)\n|' accelerated-domains.china.raw.txt
> accelerated-domains.china.unbound.conf
34 sed
-e
's|\(.*\)|forward-zone:\n name: "\1."\n forward-addr: $(SERVER)\n|' google.china.raw.txt
> google.china.unbound.conf
35 sed
-e
's|\(.*\)|forward-zone:\n name: "\1."\n forward-addr: $(SERVER)\n|' apple.china.raw.txt
> apple.china.unbound.conf
37 sed
-i
's/\r*$$/\r/' accelerated-domains.china.unbound.conf google.china.unbound.conf apple.china.unbound.conf
41 sed
-e
's|\(.*\)|zone "\1." {type forward; forwarders { $(SERVER); }; };|' accelerated-domains.china.raw.txt
> accelerated-domains.china.bind.conf
42 sed
-e
's|\(.*\)|zone "\1." {type forward; forwarders { $(SERVER); }; };|' google.china.raw.txt
> google.china.bind.conf
43 sed
-e
's|\(.*\)|zone "\1." {type forward; forwarders { $(SERVER); }; };|' apple.china.raw.txt
> apple.china.bind.conf
45 sed
-i
's/\r*$$/\r/' accelerated-domains.china.bind.conf google.china.bind.conf apple.china.bind.conf
49 sed
-e
's|\(.*\)|\1 $(SERVER)|' accelerated-domains.china.raw.txt google.china.raw.txt apple.china.raw.txt
> dnscrypt-proxy-forwarding-rules.txt
51 sed
-i
's/\r*$$/\r/' dnscrypt-proxy-forwarding-rules.txt
55 { printf
"protocol udp\nserver $(SERVER)\nparallel on \n"; cat accelerated-domains.china.raw.txt
; } > accelerated-domains.china.dnsforwarder.conf
56 { printf
"protocol udp\nserver $(SERVER)\nparallel on \n"; cat google.china.raw.txt
; } > google.china.dnsforwarder.conf
57 { printf
"protocol udp\nserver $(SERVER)\nparallel on \n"; cat apple.china.raw.txt
; } > apple.china.dnsforwarder.conf
59 sed
-i
's/\r*$$/\r/' accelerated-domains.china.dnsforwarder.conf google.china.dnsforwarder.conf apple.china.dnsforwarder.conf
63 cat google.china.raw.txt | tr
"\n" "/" | sed
-e
's|^|/|' -e
's|\(.*\)|[\1]$(SERVER)|' > google.china.adguardhome.conf
64 cat accelerated-domains.china.raw.txt | tr
"\n" "/" | sed
-e
's|^|/|' -e
's|\(.*\)|[\1]$(SERVER)|' > accelerated-domains.china.adguardhome.conf
65 cat apple.china.raw.txt | tr
"\n" "/" | sed
-e
's|^|/|' -e
's|\(.*\)|[\1]$(SERVER)|' > apple.china.adguardhome.conf
67 sed
-i
's/\r*$$/\r/' accelerated-domains.china.adguardhome.conf google.china.adguardhome.conf apple.china.adguardhome.conf
71 rm -f
{accelerated-domains
,google
,apple
}.china.
*.conf
*.smartdns.conf
{accelerated-domains
,google
,apple
}.china.raw.txt dnscrypt-proxy-forwarding-rules.txt