-
Notifications
You must be signed in to change notification settings - Fork 137
/
squid-uninstall.sh
107 lines (98 loc) · 3.54 KB
/
squid-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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
############################################################
# Squid Proxy Installer
# Author: Yujin Boby
# Email: [email protected]
# Github: https://github.com/serverok/squid-proxy-installer/
# Web: https://serverok.in/squid
# If you need professional assistance, reach out to
# https://serverok.in/contact
############################################################
if [ `whoami` != root ]; then
echo "ERROR: You need to run the script as user root or add sudo before command."
exit 1
fi
if [ ! -f /usr/bin/sok-find-os ]; then
echo "/usr/bin/sok-find-os not found"
exit 1
fi
rm -f /root/squid3-install.sh > /dev/null 2>&1
SOK_OS=$(/usr/bin/sok-find-os)
if [ $SOK_OS == "ERROR" ]; then
cat /etc/*release
echo
echo -e "\e[1;31m====================================================="
echo -e "\e[1;31mOS NOT SUPPORTED"
echo -e "\e[1;31m====================================================="
echo -e "\e[0m"
echo -e "Contact me to add support for your OS.\n"
echo -e "https://serverok.in/contact\n"
exit 1;
fi
if [ $SOK_OS == "ubuntu2404" ]; then
/usr/bin/apt -y remove --purge squid squid-common squid-langpack
rm -rf /etc/squid/
elif [ $SOK_OS == "ubuntu2204" ]; then
/usr/bin/apt -y remove --purge squid squid-common squid-langpack
rm -rf /etc/squid/
elif [ $SOK_OS == "ubuntu2004" ]; then
/usr/bin/apt -y remove --purge squid squid-common squid-langpack
rm -rf /etc/squid/
elif [ $SOK_OS == "ubuntu1804" ]; then
/usr/bin/apt -y remove --purge squid3
/bin/rm -rf /etc/squid/
elif [ $SOK_OS == "ubuntu1604" ]; then
/usr/bin/apt -y remove --purge squid3
/bin/rm -rf /etc/squid3/
/bin/rm -rf /etc/squid/
elif [ $SOK_OS == "ubuntu1404" ]; then
/usr/bin/apt remove --purge squid3 -y
/bin/rm -rf /etc/squid3/
/bin/rm -rf /etc/squid/
elif [ $SOK_OS == "debian8" ]; then
echo "Uninstalling Squid Proxy on Debian 8"
/usr/bin/apt -y remove --purge squid
/bin/rm -rf /etc/squid3/
/bin/rm -rf /etc/squid/
elif [ $SOK_OS == "debian9" ]; then
echo "Uninstalling Squid Proxy on Debian 9"
/usr/bin/apt -y remove --purge squid
/bin/rm -rf /etc/squid/
/bin/rm -rf /var/spool/squid
elif [ $SOK_OS == "debian10" ]; then
echo "Uninstalling Squid Proxy on Debian 10"
/usr/bin/apt -y remove --purge squid squid-common squid-langpack
/bin/rm -rf /etc/squid/
/bin/rm -rf /var/spool/squid
elif [ $SOK_OS == "debian11" ]; then
echo "Uninstalling Squid Proxy on Debian 11"
/usr/bin/apt -y remove --purge squid squid-common squid-langpack
/bin/rm -rf /etc/squid/
/bin/rm -rf /var/spool/squid
elif [ $SOK_OS == "debian12" ]; then
echo "Uninstalling Squid Proxy on Debian 12"
/usr/bin/apt -y remove --purge squid squid-common squid-langpack
/bin/rm -rf /etc/squid/
/bin/rm -rf /var/spool/squid
elif [ $SOK_OS == "centos7" ]; then
yum remove squid -y
/bin/rm -rf /etc/squid/
elif [ "$SOK_OS" == "centos8" ] || [ "$SOK_OS" == "almalinux8" ] || [ "$SOK_OS" == "almalinux9" ]; then
yum remove squid -y
/bin/rm -rf /etc/squid/
elif [ "$SOK_OS" == "centos8s" ]; then
dnf remove squid -y
/bin/rm -rf /etc/squid/
elif [ "$SOK_OS" == "centos9" ]; then
dnf remove squid -y
/bin/rm -rf /etc/squid/
fi
rm -f /usr/bin/squid-add-user > /dev/null 2>&1
rm -f /usr/bin/sok-find-os > /dev/null 2>&1
rm -f /usr/bin/squid-uninstall > /dev/null 2>&1
echo
echo
echo "Squid Proxy uninstalled."
echo "Thank you for using serverok.in squid proxy installer"
echo "If you want to reinstall Squid Proxy Server, check https://serverok.in/squid"
echo