-
Notifications
You must be signed in to change notification settings - Fork 4
/
uninstall_nextdns_cli.nosh
58 lines (44 loc) · 1.61 KB
/
uninstall_nextdns_cli.nosh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# v 3.2
# Michael Bierman
# https://github.com/mbierman/Firewalla-NextDNS-CLI-install
sudo nextdns uninstall
uninstall=/home/pi/.firewalla/config/post_main.d/uninstall_nextdnscli.nosh
if [ ! -f "$uninstall" ] ; then
sudo touch $uninstall
sudo chmod +xw $uninstall
sudo chown pi $uninstall
curl https://raw.githubusercontent.com/mbierman/Firewalla-NextDNS-CLI-install/main/uninstall_nextdns_cli.nosh > $uninstall
echo uninstall saved.
else
echo uninstall in place
fi
# uninstall configure NextDNS CLI on startup of Firewalla
# file goes in: /home/pi/.firewalla/config/post_main.d/
# DNS over HTTPS must be disabled in Firewalla app
# uninstall NextDNS CLI
if [ -f "/etc/apt/sources.list.d/nextdns.list" ] ; then
sudo rm -vi /etc/apt/sources.list.d/nextdns.list
else
echo "nothing to remove"
fi
sudo nextdns uninstall
if [ -f "/home/pi/.firewalla/config/post_main.d/install_nextdnscli.sh" ]; then
sudo rm -vi /home/pi/.firewalla/config/post_main.d/install_nextdnscli.sh
fi
if [ -f "/data/nextdnsdata.txt" ]; then
sudo rm -vi /data/nextdnsdata.txt
fi
if [ -f "/data/nextdnstest.sh" ]; then
sudo rm -vi /data/nextdnstest.sh
fi
if [ -f "/etc/systemd/system/nextdns.service" ]; then
sudo rm -vi /etc/systemd/system/nextdns.service
fi
unalias -a apt && sudo apt remove nextdns
if [ -f "/home/pi/.firewalla/config/dnsmasq/mynextdns.conf" ]; then
sudo rm -vi /home/pi/.firewalla/config/dnsmasq/mynextdns.conf
fi
# restart Firewalla DNS service
sudo systemctl restart firerouter_dns.service
echo -e "nextdns uninstalled\n"