-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.sh
72 lines (53 loc) · 1.18 KB
/
uninstall.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
echo ""
echo "### Documents App Uninstall"
echo ""
if [[ "$USER" != "root" ]]; then
echo ""
echo "### Please run this script as root.";
echo ""
exit;
fi
echo ""
echo "### Are you sure to uninstall?"
echo ""
echo "Are you sure to uninstall?"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo "### Continuing ..."; break;;
No ) echo "### Cancel"; exit;;
esac
done
echo ""
echo "### Stopping NodeJS server ..."
echo ""
systemctl stop documents
echo ""
echo "### Removing /etc/init/documents.conf ..."
echo ""
rm /etc/systemd/system/documents.service
echo ""
echo "### Removing packages mongodb r-base-core nodejs-legacy npm git ..."
echo ""
apt-get -y remove mongodb r-base-core libopenblas-base nodejs-legacy npm git iptables-persistent
echo ""
echo "### Removing documents folder ..."
echo ""
rm -Rf /opt/documents
rm -f /opt/documents.log
echo ""
echo "### Remove dependencies?"
echo ""
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) echo "### Uninstall complete."; exit;;
esac
done
echo ""
echo "### Removing all dependencies ..."
echo ""
apt-get -y autoremove
echo ""
echo "### Uninstall complete."
echo ""