From 43912bda99ab7e1f13fcc6a662928593610446e9 Mon Sep 17 00:00:00 2001 From: Fred Date: Tue, 28 Feb 2023 08:51:14 +0000 Subject: [PATCH] Fix sup --- squid/sup.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/squid/sup.sh b/squid/sup.sh index ce910d4..b98b749 100644 --- a/squid/sup.sh +++ b/squid/sup.sh @@ -3,13 +3,13 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin if [ -z "$supgethosts" ] && [ -z "$supicaphost" ]; then exit 0 fi +error=0 if [ -n "$supicaphost" ]; then c-icap-client -i $supicaphost -p $supicapport -s request > /tmp/test-icap-e2g-orion 2>&1 grep "200 OK" /tmp/test-icap-e2g-orion >/dev/null if [ $? = 0 ];then echo "SUP ICAP: ACCESS ICAP ok $supicaphost" - error=0 else echo "SUP ICAP: ERROR $supicaphost" exit 1 @@ -26,7 +26,6 @@ if [ -n "$supgethosts" ]; then curl -s -o /dev/null --connect-timeout 5 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/96.0" $i if [ $? = 0 ];then echo "SUP: ACCESS ok $i" - error=0 break else echo "SUP: ERROR $i" @@ -38,7 +37,7 @@ fi # Sup error because no OK before if [ "$error" = 1 ];then echo "SUP ERROR" - squid -k shutdown + pkill squid exit 1 fi