added centos 9

This commit is contained in:
Yujin Boby
2023-07-16 03:02:55 +05:30
parent 5a3d89d0b5
commit 7f17c387b6
4 changed files with 18 additions and 38 deletions

View File

@@ -40,6 +40,8 @@ elif cat /etc/os-release | grep PRETTY_NAME | grep "AlmaLinux 8" > /dev/null; th
echo "almalinux9"
elif cat /etc/os-release | grep PRETTY_NAME | grep "CentOS Stream 8" > /dev/null; then
echo "centos8s"
elif cat /etc/os-release | grep PRETTY_NAME | grep "CentOS Stream 9" > /dev/null; then
echo "centos9"
else
echo "ERROR"
fi

View File

@@ -28,41 +28,5 @@ else
/usr/bin/htpasswd -c /etc/squid/passwd $proxy_username
fi
if [ ! -f /usr/local/bin/sok-find-os ]; then
echo "/usr/local/bin/sok-find-os not found"
exit 1
fi
SOK_OS=$(/usr/local/bin/sok-find-os)
if [ "$SOK_OS" == "ERROR" ]; then
echo "OS NOT SUPPORTED.\n"
echo "Contact https://serverok.in/contact to add support for your OS."
exit 1;
fi
if [ $SOK_OS == "ubuntu2204" ]; then
systemctl reload squid
elif [ $SOK_OS == "ubuntu2004" ]; then
systemctl reload squid
elif [ $SOK_OS == "ubuntu1804" ]; then
systemctl reload squid
elif [ $SOK_OS == "ubuntu1604" ]; then
service squid restart
elif [ $SOK_OS == "ubuntu1404" ]; then
service squid3 restart
elif [ $SOK_OS == "debian8" ]; then
service squid3 restart
elif [ $SOK_OS == "debian9" ]; then
systemctl reload squid
elif [ $SOK_OS == "debian10" ]; then
systemctl reload squid
elif [ "$SOK_OS" == "debian11" ] && "$SOK_OS" == "debian12" ]; then
systemctl reload squid
elif [ $SOK_OS == "centos7" ]; then
systemctl reload squid
elif [ $SOK_OS == "centos8s" ]; then
systemctl reload squid
elif [ "$SOK_OS" == "centos8" ] || [ "$SOK_OS" == "almalinux8" ] || [ "$SOK_OS" == "almalinux9" ]; then
systemctl reload squid
fi
systemctl reload squid > /dev/null 2>&1
service squid3 restart > /dev/null 2>&1

View File

@@ -79,6 +79,9 @@ elif [ "$SOK_OS" == "centos8" ] || [ "$SOK_OS" == "almalinux8" ] || [ "$SOK_OS"
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/local/bin/squid-add-user > /dev/null 2>&1

View File

@@ -206,6 +206,17 @@ elif [ "$SOK_OS" == "centos8s" ]; then
firewall-cmd --zone=public --permanent --add-port=3128/tcp > /dev/null 2>&1
firewall-cmd --reload > /dev/null 2>&1
fi
elif [ "$SOK_OS" == "centos9" ]; then
dnf install squid httpd-tools wget -y > /dev/null 2>&1
mv /etc/squid/squid.conf /etc/squid/squid.conf.sok
/usr/bin/touch /etc/squid/blacklist.acl
/usr/bin/wget -q --no-check-certificate -O /etc/squid/squid.conf https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/conf/squid-centos7.conf
systemctl enable squid > /dev/null 2>&1
systemctl restart squid > /dev/null 2>&1
if [ -f /usr/bin/firewall-cmd ]; then
firewall-cmd --zone=public --permanent --add-port=3128/tcp > /dev/null 2>&1
firewall-cmd --reload > /dev/null 2>&1
fi
fi
echo