forked from aristocratos/btop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Uninstall
executable file
·57 lines (54 loc) · 1.13 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
#!/bin/bash
plat=`uname -s`
if [ "$plat" == "Darwin" ]
then
brew uninstall btop
else
debian=
have_apt=`type -p apt`
have_dpkg=`type -p dpkg`
have_rpm=`type -p rpm`
have_dnf=`type -p dnf`
have_pac=`type -p pacman`
[ -f /etc/os-release ] && . /etc/os-release
[ "${ID_LIKE}" == "debian" ] && debian=1
[ "${ID}" == "arch" ] && arch=1
[ "${debian}" ] || [ -f /etc/debian_version ] && debian=1
PKG=btop
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 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_rpm}" ]
then
sudo rpm -e "${PKG}"
else
echo "Cannot locate either dnf or rpm to remove. Skipping."
fi
fi
fi
fi
fi