#!/sbin/runscript # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdbguard.initd,v 1.4 2009/03/18 17:08:50 bass Exp $ depend() { need net before squid use logger } ufgt() { if [ -f "/etc/ufdbguard/blacklists/${1}/domains" ] ; then einfo "Generating domainlist $1" /usr/bin/ufdbGenTable -t ${1} -d ${UFDB_CONFDIR}/blacklists/${1}/domains fi } start() { if [ -n "${UFDB_GT}" ] ; then for gt in ${UFDB_GT} ; do ufgt ${gt} done fi if [ ! -d "${UFDB_LOGDIR}" ] ; then mkdir -p ${UFDB_LOGDIR} chown -R ${UFDB_LOGDIR} fi ebegin "Starting ufdbGuard" start-stop-daemon --start --chuid ${UFDB_USER} \ --exec ${UFDB_BINARY} --pidfile ${UFDB_PIDFILE} -- -c ${UFDB_CONF} \ ${UFDB_OPTS} eend $? "Failed to start ufdbGuard" } stop() { ebegin "Stopping ufdbGuard" start-stop-daemon --stop --exec ${UFDB_BINARY} --pidfile ${UFDB_PIDFILE} eend $? "Failed to stop ufdbGuard" }