#!/bin/bash
/sbin/iptables --list | grep "dpt:3128" > /dev/null
if [ $? -ne 0 ] ; then
	echo "inactive"
	exit
fi
squidcount=`ps aux | grep squid | grep -v Guard | grep -v grep | grep -v log | wc --lines` 
squidgcount=`ps aux | grep squidGuard | grep -v grep | grep -v log | wc --lines` 

if [ "$squidcount" -lt 1 ] ; then
	echo "error-squid"
	exit
fi

if [ "$squidgcount" -lt 1 ] ; then
	echo "error-squidGuard"
	exit
fi


cat /var/lib/groovix/filter/last-state

#echo "active"

exit

