forked from IPVS-AS/MBP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.sh
executable file
·53 lines (41 loc) · 1.54 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
#!/bin/sh
###########################################################################################
# This script removes the software components installed with the MBP installation script. #
# It removes Mosquitto, MongoDB and Tomcat. #
###########################################################################################
echo "This will uninstall the MBP from your device."
read -n1 -p "Do you also want to uninstall Tomcat? [y,n]" un_tomcat
echo ""
read -n1 -p "Do you also want to uninstall MongoDB? [y,n]" un_mongo
echo ""
read -n1 -p "Do you also want to uninstall mosquitto? [y,n]" un_mosquitto
echo ""
echo "Stopping Tomcat..."
sudo systemctl stop tomcat*
echo "Removing MBP..."
sudo rm /var/lib/tomcat*/webapps/MBP.war
sudo rm -rf /var/lib/tomcat*/webapps/MBP
# Uninstall Tomcat if desired
if [[ $un_tomcat == "Y" || $un_tomcat == "y" ]]; then
echo "Uninstalling Tomcat..."
sudo systemctl stop tomcat*
sudo apt-get remove -qy tomcat*
sudo apt purge -qy tomcat*
fi
# Uninstall MongoDB if desired
if [[ $un_mongo == "Y" || $un_mongo == "y" ]]; then
echo "Uninstalling MongoDb..."
sudo systemctl stop mongodb
sudo apt-get remove -qy mongodb-server
sudo apt purge -qy mongodb-server
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
fi
# Uninstall mosquitto if desired
if [[ $un_mosquitto == "Y" || $un_mosquitto == "y" ]]; then
echo "Uninstalling mosquitto..."
sudo systemctl stop mosquitto
sudo apt-get remove -qy mosquitto
sudo apt purge -qy mosquitto
fi
echo "Uninstalling completed."