-
Notifications
You must be signed in to change notification settings - Fork 49
/
build-custom-coredns.sh
executable file
·26 lines (26 loc) · 1.13 KB
/
build-custom-coredns.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
#!/bin/bash
cd coredns
git checkout .
git clean -dfx .
git pull
cd ../dnsredir
git pull
cd ../coredns_custom_build
git pull
cd ../coredns
git apply ../coredns_custom_build/forward.go.patch
git apply ../coredns_custom_build/forward-setup.go.patch
sed -i.bak 's|forward:forward|fallback:github.com/missdeer/fallback\ndnsredir:github.com/leiless/dnsredir\nforward:forward\nproxy:github.com/missdeer/proxy\nhttps:github.com/v-byte-cpu/coredns-https|g' plugin.cfg
sed -i.bak 's|hosts:hosts|ads:github.com/missdeer/ads\nblocklist:github.com/relekang/coredns-blocklist\nhosts:hosts|g' plugin.cfg
sed -i.bak 's|rewrite:rewrite|rewrite:rewrite\nbogus:github.com/missdeer/bogus\nipset:github.com/missdeer/ipset|g' plugin.cfg
sed -i.bak 's|cache:cache|cache:cache\nredisc:github.com/missdeer/redis|g' plugin.cfg
echo "replace (" >> go.mod
echo " github.com/leiless/dnsredir => ../dnsredir" >> go.mod
echo ")" >> go.mod
sed -i.bak '/azure/d' plugin.cfg
sed -i.bak '/route53/d' plugin.cfg
sed -i.bak '/trace/d' plugin.cfg
sed -i.bak '/etcd/d' plugin.cfg
sed -i.bak '/clouddns/d' plugin.cfg
sed -i.bak '/k8s_external/d' plugin.cfg
sed -i.bak '/kubernetes/d' plugin.cfg