-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Uninstall
executable file
·46 lines (43 loc) · 935 Bytes
/
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
#!/bin/bash
plat=`uname -s`
if [ "$plat" == "Darwin" ]
then
./macUninstall
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=doctorfree-scripts
[ "${debian}" ] || PKG=DoctorFreeScripts
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 [ "${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