Skip to content

Commit

Permalink
added centos 9
Browse files Browse the repository at this point in the history
  • Loading branch information
serverok committed Jul 15, 2023
1 parent 5a3d89d commit 7f17c38
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 38 deletions.
2 changes: 2 additions & 0 deletions sok-find-os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 2 additions & 38 deletions squid-add-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions squid-uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions squid3-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7f17c38

Please sign in to comment.