From ed82f2b30f1695d7336319926a34a604a2443e0e Mon Sep 17 00:00:00 2001 From: Yujin Boby Date: Wed, 22 May 2024 23:26:28 +0530 Subject: [PATCH] script updated --- squid-uninstall.sh | 12 ++++++------ squid3-install.sh | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/squid-uninstall.sh b/squid-uninstall.sh index a1048cb..cbf5447 100644 --- a/squid-uninstall.sh +++ b/squid-uninstall.sh @@ -15,12 +15,12 @@ if [ `whoami` != root ]; then exit 1 fi -if [ ! -f /usr/local/bin/sok-find-os ]; then - echo "/usr/local/bin/sok-find-os not found" +if [ ! -f /usr/bin/sok-find-os ]; then + echo "/usr/bin/sok-find-os not found" exit 1 fi -SOK_OS=$(/usr/local/bin/sok-find-os) +SOK_OS=$(/usr/bin/sok-find-os) if [ $SOK_OS == "ERROR" ]; then cat /etc/*release @@ -93,10 +93,10 @@ elif [ "$SOK_OS" == "centos9" ]; then /bin/rm -rf /etc/squid/ fi -rm -f /usr/local/bin/squid-add-user > /dev/null 2>&1 +rm -f /usr/bin/squid-add-user > /dev/null 2>&1 rm -f /root/squid3-install.sh > /dev/null 2>&1 -rm -f /usr/local/bin/sok-find-os > /dev/null 2>&1 -rm -f /usr/local/bin/squid-uninstall > /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 echo echo diff --git a/squid3-install.sh b/squid3-install.sh index 41f44a7..c8fa9fd 100644 --- a/squid3-install.sh +++ b/squid3-install.sh @@ -15,14 +15,14 @@ if [ `whoami` != root ]; then exit 1 fi -/usr/bin/wget -q --no-check-certificate -O /usr/local/bin/sok-find-os https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/sok-find-os.sh > /dev/null 2>&1 -chmod 755 /usr/local/bin/sok-find-os +/usr/bin/wget -q --no-check-certificate -O /usr/bin/sok-find-os https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/sok-find-os.sh > /dev/null 2>&1 +chmod 755 /usr/bin/sok-find-os -/usr/bin/wget -q --no-check-certificate -O /usr/local/bin/squid-uninstall https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/squid-uninstall.sh > /dev/null 2>&1 -chmod 755 /usr/local/bin/squid-uninstall +/usr/bin/wget -q --no-check-certificate -O /usr/bin/squid-uninstall https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/squid-uninstall.sh > /dev/null 2>&1 +chmod 755 /usr/bin/squid-uninstall -/usr/bin/wget -q --no-check-certificate -O /usr/local/bin/squid-add-user https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/squid-add-user.sh > /dev/null 2>&1 -chmod 755 /usr/local/bin/squid-add-user +/usr/bin/wget -q --no-check-certificate -O /usr/bin/squid-add-user https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/squid-add-user.sh > /dev/null 2>&1 +chmod 755 /usr/bin/squid-add-user if [[ -d /etc/squid/ || -d /etc/squid3/ ]]; then echo -e "\nSquid Proxy already installed.\n" @@ -31,12 +31,12 @@ if [[ -d /etc/squid/ || -d /etc/squid3/ ]]; then exit 1 fi -if [ ! -f /usr/local/bin/sok-find-os ]; then - echo "/usr/local/bin/sok-find-os not found" +if [ ! -f /usr/bin/sok-find-os ]; then + echo "/usr/bin/sok-find-os not found" exit 1 fi -SOK_OS=$(/usr/local/bin/sok-find-os) +SOK_OS=$(/usr/bin/sok-find-os) if [ $SOK_OS == "ERROR" ]; then cat /etc/*release @@ -45,8 +45,9 @@ if [ $SOK_OS == "ERROR" ]; then exit 1; fi +echo -e "Installing squid on ${SOK_OS}, please wait....\n" + if [ $SOK_OS == "ubuntu2404" ]; then - echo -e "Installing squid, please wait....\n" /usr/bin/apt update > /dev/null 2>&1 /usr/bin/apt -y install apache2-utils squid > /dev/null 2>&1 touch /etc/squid/passwd @@ -243,4 +244,3 @@ echo echo -e "${CYAN}To create a proxy user, run command: squid-add-user${NC}" echo -e "${CYAN}To change squid proxy port, see ${GREEN}https://serverok.in/how-to-change-port-of-squid-proxy-server${NC}" echo -e "${NC}" -