#!/bin/sh

if [ "$1" = "config" ]; then

	echo 'host_name adherents'
	echo 'graph_title Blacklist'
	echo "graph_args --base 1000 --lower-limit 0"
	echo "graph_vlabel nb de machines"
	echo 'carte_et.label Certif. études'
	echo 'carte_et.draw AREA'
	echo 'chbre.label Chambre invalide'
	echo 'chbre.draw STACK'
	echo 'bloq.label Blocage'
	echo 'bloq.draw STACK'
	echo 'upload.label Upload'
	echo 'upload.draw STACK'
	echo 'p2p.label P2P'
	echo 'p2p.draw STACK'
	echo 'auto_upload.label Autodisc. Upload'
	echo 'auto_upload.draw STACK'
	echo 'auto_p2p.label Autodisc. P2P'
	echo 'auto_p2p.draw STACK'
	echo 'virus.label Virus'
	echo 'virus.draw STACK'
	echo 'warez.label Warez'
	echo 'warez.draw STACK'
	echo 'total.label Total'
	exit 0
fi

echo -n "carte_et.value "
cat /etc/squid/blacklist_carte_et | wc -l
echo -n "chbre.value "
cat /etc/squid/blacklist_chbre | wc -l
echo -n "bloq.value "
cat /etc/squid/blacklist_bloq | wc -l
echo -n "virus.value "
cat /etc/squid/blacklist_virus | wc -l
echo -n "upload.value "
cat /etc/squid/blacklist_upload | wc -l
echo -n "p2p.value "
cat /etc/squid/blacklist_p2p | wc -l
echo -n "auto_upload.value "
cat /etc/squid/blacklist_autodisc_upload | wc -l
echo -n "auto_p2p.value "
cat /etc/squid/blacklist_autodisc_p2p | wc -l
echo -n "warez.value "
cat /etc/squid/blacklist_warez | wc -l
echo -n "total.value "
find /etc/squid -name 'blacklist_*' ! -name '*\~' -exec cat {} \; | uniq | wc -l

