#!/bin/sh
ChrootDir="/var/packages/ProxyServer/target/squid"
LOGDir=${ChrootDir}"/var/logs/"
/sbin/initctl stop pkg-ProxyServer
COUNT=60
while [ "0" -lt "`/usr/bin/ps -ef | /usr/bin/grep -v grep | /usr/bin/grep -c squid`" ]; do
if [ "0" -eq "$COUNT" ]; then
echo "Time out: Squid shutdown script fail!\n" >> $LOGDir/error.log
exit 1
fi
sleep 1
COUNT=$(($COUNT-1))
done