-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Uninstall
executable file
·79 lines (71 loc) · 1.69 KB
/
Uninstall
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
#!/bin/bash
#
# shellcheck disable=SC1090,SC2220,SC2207,SC2068,SC2001
uninstall() {
LOCAL="/usr/local"
APPL=${LOCAL}/share/applications
DOC=${LOCAL}/share/doc
ROON=${LOCAL}/Roon
ROONBIN=${ROON}/bin
[ -d /usr/local/bin ] && {
cd /usr/local/bin || exit 1
for command in "${ROONBIN}"/*
do
[ "${command}" == "${ROONBIN}/*" ] && continue
b=$(basename "${command}")
[ -L "$b" ] && {
/bin/ls -l "$b" | grep ${ROON} > /dev/null && sudo rm -f "$b"
}
done
}
sudo rm -rf ${ROON}
sudo rm -rf ${DOC}/RoonCommandLine
sudo rm -f ${APPL}/rooncommand.desktop
echo ""
echo "RoonCommandLine uninstalled"
}
have_fade=$(type -p roon_fade)
[ "${have_fade}" ] && roon_fade off
plat=$(uname -s)
if [ "$plat" == "Darwin" ]
then
uninstall
else
debian=
have_apt=$(type -p apt)
have_dpkg=$(type -p dpkg)
have_rpm=$(type -p rpm)
have_yum=$(type -p yum)
[ -f /etc/os-release ] && . /etc/os-release
[ "${ID_LIKE}" == "debian" ] && debian=1
[ "${debian}" ] || [ -f /etc/debian_version ] && debian=1
PKG=rooncommandline
[ "${debian}" ] || PKG=RoonCommandLine
if [ "${debian}" ]
then
if [ "${have_apt}" ]
then
sudo apt remove "${PKG}" -y > /dev/null 2>&1
else
if [ "${have_dpkg}" ]
then
sudo dpkg -r "${PKG}" > /dev/null 2>&1
else
echo "Cannot locate either apt or dpkg to remove. Skipping."
fi
fi
else
if [ "${have_yum}" ]
then
sudo yum remove "${PKG}" > /dev/null 2>&1
else
if [ "${have_rpm}" ]
then
sudo rpm -e "${PKG}" > /dev/null 2>&1
else
echo "Cannot locate either yum or rpm to remove. Skipping."
fi
fi
fi
uninstall
fi