Merge branch 'fredbcode-master-patch-63008' into 'master'
Update squid/sup.sh See merge request fredbcode-images/squid!16
This commit is contained in:
commit
2d1e7912a9
46
squid/sup.sh
46
squid/sup.sh
@ -4,41 +4,37 @@ if [ -z "$supgethosts" ] && [ -z "$supicaphost" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
date=$(date +%d-%m-%Y_%w)
|
||||
error=0
|
||||
if [ -n "$supgethosts" ]; then
|
||||
for i in ${supgethosts[@]}
|
||||
do
|
||||
echo "CHECK: $i"
|
||||
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"
|
||||
if [ -z "$supicaphost" ]; then
|
||||
exit 0
|
||||
else
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "SUP: ERROR $i"
|
||||
error=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
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"
|
||||
exit 0
|
||||
error=0
|
||||
else
|
||||
echo "SUP ICAP: ERROR $supicaphost"
|
||||
error=1
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
date=$(date +%d-%m-%Y_%w)
|
||||
if [ -n "$supgethosts" ]; then
|
||||
for i in ${supgethosts[@]}
|
||||
do
|
||||
echo "CHECK: $i"
|
||||
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"
|
||||
error=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Sup error because no OK before
|
||||
if [ "$error" = 1 ];then
|
||||
echo "SUP ERROR"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user