From fdb46b008ebe54af44442c291461b927e6d539ec Mon Sep 17 00:00:00 2001 From: Yujin Boby Date: Sat, 15 Jul 2023 23:31:34 +0530 Subject: [PATCH] added debian 12 support --- README.md | 2 +- sok-find-os.sh | 2 ++ squid-add-user.sh | 2 +- squid3-install.sh | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c0e37c8..8c3b075 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ https://serverok.in/squid Auto install Squid 3 proxy on following linux OS. * Ubuntu 14.04, 16.04, 18.04, 20.04, 22.04 -* Debian 8, 9, 10, 11 +* Debian 8, 9, 10, 11, 12 * CentOS 7, 8 * AlmaLinux 8, 9 diff --git a/sok-find-os.sh b/sok-find-os.sh index 6f07a11..4da9fb2 100755 --- a/sok-find-os.sh +++ b/sok-find-os.sh @@ -28,6 +28,8 @@ elif cat /etc/os-release | grep PRETTY_NAME | grep "buster" > /dev/null; then echo "debian10" elif cat /etc/os-release | grep PRETTY_NAME | grep "bullseye" > /dev/null; then echo "debian11" +elif cat /etc/os-release | grep PRETTY_NAME | grep "bookworm" > /dev/null; then + echo "debian12" elif cat /etc/os-release | grep PRETTY_NAME | grep "CentOS Linux 7" > /dev/null; then echo "centos7" elif cat /etc/os-release | grep PRETTY_NAME | grep "CentOS Linux 8" > /dev/null; then diff --git a/squid-add-user.sh b/squid-add-user.sh index d6027e9..0b9d064 100644 --- a/squid-add-user.sh +++ b/squid-add-user.sh @@ -57,7 +57,7 @@ elif [ $SOK_OS == "debian9" ]; then systemctl reload squid elif [ $SOK_OS == "debian10" ]; then systemctl reload squid -elif [ $SOK_OS == "debian11" ]; then +elif [ "$SOK_OS" == "debian11" ] && "$SOK_OS" == "debian12" ]; then systemctl reload squid elif [ $SOK_OS == "centos7" ]; then systemctl reload squid diff --git a/squid3-install.sh b/squid3-install.sh index e4f6896..acec8db 100644 --- a/squid3-install.sh +++ b/squid3-install.sh @@ -158,6 +158,21 @@ elif [ $SOK_OS == "debian11" ]; then fi systemctl enable squid systemctl restart squid +elif [ $SOK_OS == "debian12" ]; then + # OS = Debian GNU/Linux 12 (bookworm) + /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/serverok/squid-proxy-installer/master/squid.conf + if [ -f /sbin/iptables ]; then + /sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT + /sbin/iptables-save + fi + systemctl enable squid + systemctl restart squid elif [ $SOK_OS == "centos7" ]; then yum install squid httpd-tools -y /bin/rm -f /etc/squid/squid.conf