-
Notifications
You must be signed in to change notification settings - Fork 4
/
squid3-install.sh
98 lines (95 loc) · 4.2 KB
/
squid3-install.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
#!/bin/bash
# Squid Installer
# Author: https://radwebhosting.com
# Email: [email protected]
# Github: https://github.com/Rad-Web-Hosting/squid-proxy
if cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 18.04"; then
/usr/bin/apt update
/usr/bin/apt -y install apache2-utils squid3
touch /etc/squid/passwd
/bin/rm -f /etc/squid/squid.conf
/usr/bin/touch /etc/squid/blacklist.acl
/usr/bin/wget --no-check-certificate -O /etc/squid/squid.conf https://raw.githubusercontent.com/Rad-Web-Hosting/squid-proxy/master/squid.conf
/sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
/sbin/iptables-save
service squid restart
systemctl enable squid
elif cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 16.04"; then
/usr/bin/apt update
/usr/bin/apt -y install apache2-utils squid3
touch /etc/squid/passwd
/bin/rm -f /etc/squid/squid.conf
/usr/bin/touch /etc/squid/blacklist.acl
/usr/bin/wget --no-check-certificate -O /etc/squid/squid.conf https://raw.githubusercontent.com/Rad-Web-Hosting/squid-proxy/master/squid.conf
/sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
/sbin/iptables-save
service squid restart
update-rc.d squid defaults
elif cat /etc/*release | grep DISTRIB_DESCRIPTION | grep "Ubuntu 14.04"; then
/usr/bin/apt update
/usr/bin/apt -y install apache2-utils squid3
touch /etc/squid3/passwd
/bin/rm -f /etc/squid3/squid.conf
/usr/bin/touch /etc/squid3/blacklist.acl
/usr/bin/wget --no-check-certificate -O /etc/squid3/squid.conf https://raw.githubusercontent.com/Rad-Web-Hosting/squid-proxy/master/squid.conf
/sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
/sbin/iptables-save
service squid3 restart
ln -s /etc/squid3 /etc/squid
#update-rc.d squid3 defaults
ln -s /etc/squid3 /etc/squid
elif cat /etc/os-release | grep PRETTY_NAME | grep "jessie"; then
# OS = Debian 8
/bin/rm -rf /etc/squid
/usr/bin/apt update
/usr/bin/apt -y install apache2-utils squid3
touch /etc/squid3/passwd
/bin/rm -f /etc/squid3/squid.conf
/usr/bin/touch /etc/squid3/blacklist.acl
/usr/bin/wget --no-check-certificate -O /etc/squid3/squid.conf https://raw.githubusercontent.com/Rad-Web-Hosting/squid-proxy/master/squid.conf
/sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
/sbin/iptables-save
service squid3 restart
update-rc.d squid3 defaults
ln -s /etc/squid3 /etc/squid
elif cat /etc/os-release | grep PRETTY_NAME | grep "stretch"; then
# OS = Debian 9
/bin/rm -rf /etc/squid
/usr/bin/apt update
/usr/bin/apt -y install apache2-utils squid
touch /etc/squid/passwd
/bin/rm -f /etc/squid/squid.conf
/usr/bin/touch /etc/squid/blacklist.acl
/usr/bin/wget --no-check-certificate -O /etc/squid/squid.conf https://raw.githubusercontent.com/Rad-Web-Hosting/squid-proxy/master/squid.conf
/sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
/sbin/iptables-save
systemctl enable squid
systemctl restart squid
elif cat /etc/os-release | grep PRETTY_NAME | grep "buster"; then
# OS = Debian 10
/bin/rm -rf /etc/squid
/usr/bin/apt update
/usr/bin/apt -y install apache2-utils squid
touch /etc/squid/passwd
/bin/rm -f /etc/squid/squid.conf
/usr/bin/touch /etc/squid/blacklist.acl
/usr/bin/wget --no-check-certificate -O /etc/squid/squid.conf https://raw.githubusercontent.com/Rad-Web-Hosting/squid-proxy/master/squid.conf
/sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
/sbin/iptables-save
systemctl enable squid
systemctl restart squid
elif cat /etc/os-release | grep PRETTY_NAME | grep "CentOS Linux 7"; then
yum install squid httpd-tools -y
/bin/rm -f /etc/squid/squid.conf
/usr/bin/touch /etc/squid/blacklist.acl
/usr/bin/wget --no-check-certificate -O /etc/squid/squid.conf https://raw.githubusercontent.com/Rad-Web-Hosting/squid-proxy/master/squid-centos7.conf
systemctl enable squid
systemctl restart squid
firewall-cmd --zone=public --permanent --add-port=3128/tcp
firewall-cmd --reload
else
echo "OS NOT SUPPORTED.\n"
echo "Contact [email protected] to add support for your os."
exit 1;
fi
#/usr/bin/htpasswd -b -c /etc/squid/passwd USERNAME_HERE PASSWORD_HERE