forked from mriza/XMind-Linux-Installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmind-uninstall.sh
executable file
·85 lines (81 loc) · 1.63 KB
/
xmind-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
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/usr/env bash
#
# This script reverses the installation process.
# Changes made to the install script should be updated here as well.
#
function echoY() {
prompt="$1"
echo -e -n "\033[32m$prompt"
echo -e -n '\033[0m'
echo ''
}
function echoR() {
prompt="$1"
echo -e -n "\033[31m$prompt"
echo -e -n '\033[0m'
echo ''
}
# Check first for username and then load config
source ./xmind.conf
status_flag=0
echoY "Uninstalling XMind"
echoY "Removing files..."
rm -rf "${XMIND_DIR}"
if [ $? != 0 ]
then
status_flag=1
echoR "Failed"
else
echoY "OK"
fi
echoY "Removing user data..."
rm -rf "${XMIND_WORKSPACE}"
if [ $? != 0 ]
then
status_flag=1
echoR "Failed"
else
echoY "OK"
fi
echoY "Removing configs..."
rm -rf "${XMIND_CONFIG}"
if [ $? != 0 ]
then
status_flag=1
echoR "Failed"
else
echoY "OK"
fi
echoY "Removing launcher, mime, fonts, icon..."
rm "$HOME"/.local/share/applications/xmind.desktop \
"$HOME"/.local/share/mime/packages/xmind.xml \
"$HOME"/.local/share/fonts/xmind/** \
"$HOME"/.local/share/icons/hicolor/scalable/**/*xmind.svg
rmdir "$HOME"/.local/share/fonts/xmind/
if [ $? != 0 ]
then
status_flag=1
echoR "Failed"
else
echoY "OK"
fi
echoY "...Updating MIME, applications, font and icon database"
update-desktop-database "$HOME"/.local/share/applications
update-mime-database "$HOME"/.local/share/mime
gtk-update-icon-cache --quiet "$HOME"/.local/share/icons/hicolor/ -f
fc-cache -f
if [ $? != 0 ]
then
status_flag=1
echoR "Failed"
else
echoY "OK"
fi
if [ $status_flag != 0 ]
then
echoR "Some errors found..."
exit 1
else
echoY "Uninstallation finished succesfully"
exit 0
fi