forked from allanchen2019/mosdns-debian-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-mosdns.sh
27 lines (22 loc) · 1.16 KB
/
install-mosdns.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
#!/bin/bash
architecture=$(dpkg --print-architecture)
cd /opt/mosdns || exit
mkdir bin
cd bin || exit
echo "下载mosdns和域名表……"
wget --show-progress -t 5 -T 10 -cqO mosdns.zip https://github.com/IrineSistiana/mosdns/releases/latest/download/mosdns-linux-"$architecture".zip
wget --show-progress -t 5 -T 10 -cqO accelerated-domains.china.conf https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf
wget --show-progress -t 5 -T 10 -cqO apple.china.conf https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf
sed -r 's/.{8}//' accelerated-domains.china.conf > accelerated-domains.china.conf2
sed -r 's/.{16}$//' accelerated-domains.china.conf2 > accelerated-domains.china.conf.raw.txt
sed -r 's/.{8}//' apple.china.conf > apple.china.conf2
sed -r 's/.{16}$//' apple.china.conf2 > apple.china.conf.raw.txt
echo "停用systemd-resolved……"
systemctl stop systemd-resolved.service
systemctl disable systemd-resolved.service
systemctl daemon-reload
echo "启动mosdns……"
unzip -o mosdns.zip
./mosdns service install -c /opt/mosdns/config-v5.yaml
./mosdns service start
systemctl enable mosdns.service