-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Uninstall
executable file
·62 lines (59 loc) · 1.29 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
#!/bin/bash
debian=
arch=
have_apt=`type -p apt`
have_dpkg=`type -p dpkg`
have_rpm=`type -p rpm`
have_dnf=`type -p dnf`
have_yum=`type -p yum`
have_pac=`type -p pacman`
[ -f /etc/os-release ] && . /etc/os-release
[ "${ID_LIKE}" == "debian" ] && debian=1
[ "${ID}" == "arch" ] || [ "${ID_LIKE}" == "arch" ] && arch=1
[ "${debian}" ] || [ -f /etc/debian_version ] && debian=1
[ "${arch}" ] || [ "${debian}" ] || {
echo "${ID_LIKE}" | grep debian > /dev/null && debian=1
}
PKG=musicplayerplus
[ "${debian}" ] || [ "${arch}" ] || PKG=MusicPlayerPlus
if [ "${debian}" ]
then
if [ "${have_apt}" ]
then
sudo apt remove "${PKG}" -y
else
if [ "${have_dpkg}" ]
then
sudo dpkg -r "${PKG}"
else
echo "Cannot locate either apt or dpkg to remove. Skipping."
fi
fi
else
if [ "${arch}" ]
then
if [ "${have_pac}" ]
then
sudo pacman -Rs "${PKG}"
else
echo "Cannot locate pacman to remove. Skipping."
fi
else
if [ "${have_dnf}" ]
then
sudo dnf remove "${PKG}"
else
if [ "${have_yum}" ]
then
sudo yum remove "${PKG}"
else
if [ "${have_rpm}" ]
then
sudo rpm -e "${PKG}"
else
echo "Cannot locate either yum or rpm to remove. Skipping."
fi
fi
fi
fi
fi