#!/bin/sh
# $FreeBSD: ports/Tools/portbuild/scripts/flushsquid,v 1.4 2010/06/25 22:49:56 linimon Exp $

# client script to be manually run to flush squid cache, whenever needed

# note: uname is not being overridden
arch=$(uname -m)
pb=/var/portbuild
. ${pb}/${arch}/client.conf
. ${pb}/${arch}/portbuild.conf

host=$(hostname)
test -f ${pb}/${arch}/portbuild.${host} && . ${pb}/${arch}/portbuild.${host}

if [ ! -z "${squid_dir}" ] ; then
	/usr/local/etc/rc.d/squid stop 
	/usr/local/etc/rc.d/squid poll
	echo "" > ${squid_dir}/cache/swap.state
	/usr/local/etc/rc.d/squid start
fi
