From a46afa12135f1087f176a533890a5634fbde4bf4 Mon Sep 17 00:00:00 2001 From: Yujin Boby Date: Wed, 22 May 2024 23:38:13 +0530 Subject: [PATCH] proxy updated --- squid-uninstall.sh | 3 ++- squid3-install.sh | 25 ++++++++----------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/squid-uninstall.sh b/squid-uninstall.sh index cbf5447..ae8ce1b 100644 --- a/squid-uninstall.sh +++ b/squid-uninstall.sh @@ -20,6 +20,8 @@ if [ ! -f /usr/bin/sok-find-os ]; then exit 1 fi +rm -f /root/squid3-install.sh > /dev/null 2>&1 + SOK_OS=$(/usr/bin/sok-find-os) if [ $SOK_OS == "ERROR" ]; then @@ -94,7 +96,6 @@ elif [ "$SOK_OS" == "centos9" ]; then fi rm -f /usr/bin/squid-add-user > /dev/null 2>&1 -rm -f /root/squid3-install.sh > /dev/null 2>&1 rm -f /usr/bin/sok-find-os > /dev/null 2>&1 rm -f /usr/bin/squid-uninstall > /dev/null 2>&1 diff --git a/squid3-install.sh b/squid3-install.sh index c8fa9fd..7cba45d 100644 --- a/squid3-install.sh +++ b/squid3-install.sh @@ -68,7 +68,6 @@ elif [ $SOK_OS == "ubuntu2204" ]; then /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 - /sbin/iptables-save fi service squid restart systemctl enable squid @@ -81,7 +80,6 @@ elif [ $SOK_OS == "ubuntu2004" ]; then /usr/bin/wget -q --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 service squid restart systemctl enable squid @@ -104,7 +102,6 @@ elif [ $SOK_OS == "ubuntu1604" ]; then /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/squid.conf /sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT - /sbin/iptables-save service squid restart update-rc.d squid defaults elif [ $SOK_OS == "ubuntu1404" ]; then @@ -115,7 +112,6 @@ elif [ $SOK_OS == "ubuntu1404" ]; then /usr/bin/touch /etc/squid3/blacklist.acl /usr/bin/wget -q --no-check-certificate -O /etc/squid3/squid.conf https://raw.githubusercontent.com/serverok/squid-proxy-installer/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 @@ -130,7 +126,6 @@ elif [ $SOK_OS == "debian8" ]; then /usr/bin/touch /etc/squid3/blacklist.acl /usr/bin/wget -q --no-check-certificate -O /etc/squid3/squid.conf https://raw.githubusercontent.com/serverok/squid-proxy-installer/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 @@ -144,7 +139,6 @@ elif [ $SOK_OS == "debian9" ]; then /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/squid.conf /sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT - /sbin/iptables-save systemctl enable squid systemctl restart squid elif [ $SOK_OS == "debian10" ]; then @@ -157,7 +151,6 @@ elif [ $SOK_OS == "debian10" ]; then /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/squid.conf /sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT - /sbin/iptables-save systemctl enable squid systemctl restart squid elif [ $SOK_OS == "debian11" ]; then @@ -171,7 +164,6 @@ elif [ $SOK_OS == "debian11" ]; then /usr/bin/wget -q --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 @@ -184,7 +176,6 @@ elif [ $SOK_OS == "debian12" ]; then /usr/bin/wget -q --no-check-certificate -O /etc/squid/conf.d/serverok.conf https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/conf/debian12.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 @@ -196,8 +187,8 @@ elif [ $SOK_OS == "centos7" ]; then systemctl enable squid systemctl restart squid 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 + firewall-cmd --zone=public --permanent --add-port=3128/tcp > /dev/null 2>&1 + firewall-cmd --reload > /dev/null 2>&1 fi elif [ "$SOK_OS" == "centos8" ] || [ "$SOK_OS" == "almalinux8" ] || [ "$SOK_OS" == "almalinux9" ]; then yum install squid httpd-tools wget -y @@ -207,8 +198,8 @@ elif [ "$SOK_OS" == "centos8" ] || [ "$SOK_OS" == "almalinux8" ] || [ "$SOK_OS" systemctl enable squid systemctl restart squid 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 + firewall-cmd --zone=public --permanent --add-port=3128/tcp > /dev/null 2>&1 + firewall-cmd --reload > /dev/null 2>&1 fi elif [ "$SOK_OS" == "centos8s" ]; then dnf install squid httpd-tools wget -y > /dev/null 2>&1 @@ -218,8 +209,8 @@ elif [ "$SOK_OS" == "centos8s" ]; then 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 + 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 @@ -229,8 +220,8 @@ elif [ "$SOK_OS" == "centos9" ]; then 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 + firewall-cmd --zone=public --permanent --add-port=3128/tcp > /dev/null 2>&1 + firewall-cmd --reload > /dev/null 2>&1 fi fi