-
Notifications
You must be signed in to change notification settings - Fork 1
/
uninstall.sh
executable file
·56 lines (42 loc) · 1.2 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/bash
source config/zymp3.conf #get $INSTALLPATH variable from config
if [[ $EUID -ne 0 ]]; then
echo "$0 : This script must be run as root"
exit 1
fi
if [ ! -d ${INSTALLPATH} ];then
INSTALLDIR=0
else
INSTALLDIR=1
fi
if [ ! -f /usr/bin/zymp3 ];then
BINFILE=0
else
BINFILE=1
fi
if [ ! -f /usr/share/applications/zymp3.desktop ];then
DESKTOPFILE=0
else
DESKTOPFILE=1
fi
COUNT=$(expr ${INSTALLDIR} + ${BINFILE} + ${DESKTOPFILE})
if [ "${COUNT}" = "3" ];then
echo -e "\e[93m Looks like zymp3 is still installed \033[0m"
echo -n "Would you like to remove all files?[y/n]: "
read CHOICE
if [ "${CHOICE}" = "y" ];then
rm -v -R ${INSTALLPATH} && INSTALLDIR=0
rm -v /usr/bin/zymp3 && BINFILE=0
rm -v /usr/share/applications/zymp3.desktop && DESKTOPFILE=0
COUNT=$(expr ${INSTALLDIR} + ${BINFILE} + ${DESKTOPFILE})
if [ "${COUNT}" = "0" ];then
echo -e "\e[92m Zymp3 has been successfully is uninstalled \033[0m"
else
echo "$COUNT"
echo "It seems the uninstall did not go smoothly."
echo "Please file a bug report at: https://github.com/silvernode/zymp3/issues"
fi
fi
else
echo "Zymp3 is not installed, please run install.sh"
fi