-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathuninstall.sh
executable file
·67 lines (67 loc) · 1.05 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
#!/bin/bash
usage(){
echo "USAGE:
sudo uninstall.sh username"
exit 1
}
# Must be run as root
if [ "$EUID" -ne 0 ]; then usage; fi
# Must specify username
if [ -z "$1" ]; then usage; fi
USER=$1
status_flag=0
echo "Uninstalling XMind"
echo "Removing files..."
rm -rf /opt/xmind/
if [ $? != 0 ]
then
status_flag=1
echo "Failed"
else
echo "OK"
fi
echo "Removing user data..."
rm -rf /home/$USER/.workspace
if [ $? != 0 ]
then
status_flag=1
echo "Failed"
else
echo "OK"
fi
echo "Removing configs..."
rm -rf /home/$USER/{.configuration,p2}
if [ $? != 0 ]
then
status_flag=1
echo "Failed"
else
echo "OK"
fi
echo "Removing launcher..."
rm -rf /usr/share/applications/xmind8.desktop
if [ $? != 0 ]
then
status_flag=1
echo "Failed"
else
echo "OK"
fi
echo "...Updating MIME database"
rm /usr/share/mime/packages/xmind.xml
update-mime-database /usr/share/mime
if [ $? != 0 ]
then
status_flag=1
echo "Failed"
else
echo "OK"
fi
if [ $status_flag != 0 ]
then
echo "Some errors found..."
exit 1
else
echo "Uninstallation finished succesfully"
exit 0
fi