Skip to content

Commit

Permalink
added support for ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
serverok committed May 1, 2024
1 parent e383c94 commit ea0a4de
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
4 changes: 3 additions & 1 deletion sok-find-os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
# https://serverok.in/contact
############################################################

if cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 22.04" > /dev/null; then
if cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 24.04" > /dev/null; then
echo "ubuntu2404"
elif cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 22.04" > /dev/null; then
echo "ubuntu2204"
elif cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 20.04" > /dev/null; then
echo "ubuntu2004"
Expand Down
10 changes: 7 additions & 3 deletions squid-uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ 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."
cat /etc/*release
echo -e "\nOS NOT SUPPORTED.\n"
echo -e "Contact https://serverok.in/contact to add support for your OS.\n"
exit 1;
fi

if [ $SOK_OS == "ubuntu2204" ]; then
if [ $SOK_OS == "ubuntu2404" ]; then
/usr/bin/apt -y remove --purge squid squid-common squid-langpack
rm -rf /etc/squid/
elif [ $SOK_OS == "ubuntu2204" ]; then
/usr/bin/apt -y remove --purge squid squid-common squid-langpack
rm -rf /etc/squid/
elif [ $SOK_OS == "ubuntu2004" ]; then
Expand Down
19 changes: 16 additions & 3 deletions squid3-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,25 @@ 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."
cat /etc/*release
echo -e "\nOS NOT SUPPORTED.\n"
echo -e "Contact https://serverok.in/contact to add support for your OS.\n"
exit 1;
fi

if [ $SOK_OS == "ubuntu2204" ]; then
if [ $SOK_OS == "ubuntu2404" ]; then
/usr/bin/apt update > /dev/null 2>&1
/usr/bin/apt -y install apache2-utils squid > /dev/null 2>&1
touch /etc/squid/passwd
mv /etc/squid/squid.conf /etc/squid/squid.conf.bak
/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/ubuntu-2204.conf
if [ -f /sbin/iptables ]; then
/sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
fi
systemctl enable squid
service squid restart
elif [ $SOK_OS == "ubuntu2204" ]; then
/usr/bin/apt update > /dev/null 2>&1
/usr/bin/apt -y install apache2-utils squid > /dev/null 2>&1
touch /etc/squid/passwd
Expand Down

0 comments on commit ea0a4de

Please sign in to comment.