forked from mriza/XMind-Linux-Installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
64 lines (64 loc) · 981 Bytes
/
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
#!/bin/bash
if [ -z "$1" ]
then
echo "USAGE:
sudo xmind-installer.sh username"
exit 1
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