-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.debian.sh
42 lines (31 loc) · 876 Bytes
/
setup.debian.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Install dnsmasq
su root
echo "#### INSTALLING DSNMASQ ####"
apt install dnsmasq
apt install nodejs
# Write config files
echo "#### WRITING CONFIG FILES ####"
echo "nameserver 127.0.0.1" > /etc/resolv.conf
echo "nameserver 1.1.1.1" > /etc/resolv.dnsmasq
# Set up siteblock
cd /etc
git clone https://git.io/Jnn08
# Create a systemd service file
echo "[Unit]
Description=Sitebock
[Service]
ExecStart=${which node} /etc/siteblock/engine/app.js
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/siteblock.service
# Enable and start the service
systemctl enable siteblock.service
systemctl start siteblock.service
# Write the dnsmask config file
echo "addn-hosts=/etc/hosts.blacklist
domain-needed
bogus-priv
cache-size=1000
resolv-file=/etc/resolv.dnsmasq" > /etc/dnsmasq.conf
systemctl enable dnsmasq
systemctl start dnsmasq
systemctl restart NetworkManager