-
Notifications
You must be signed in to change notification settings - Fork 0
/
squid3-install.sh
52 lines (48 loc) · 2.03 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
#!/bin/bash
# Squid Installer
# Author: https://blog.hostonnet.com
# Email: [email protected]
# Github: https://github.com/HostOnNet/squid-proxy-installer
if 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/sinun98/awsipauth/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/sinun98/awsipauth/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/sinun98/awsipauth/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
else
echo "OS NOT SUPPORTED. Contact [email protected] to add support for your OS"
exit 1;
fi
#/usr/bin/htpasswd -b -c /etc/squid/passwd USERNAME_HERE PASSWORD_HERE