summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-proxy/ufdbguard/files/ufdbguard.initd')
-rw-r--r--net-proxy/ufdbguard/files/ufdbguard.initd43
1 files changed, 43 insertions, 0 deletions
diff --git a/net-proxy/ufdbguard/files/ufdbguard.initd b/net-proxy/ufdbguard/files/ufdbguard.initd
new file mode 100644
index 000000000000..e6e27067ec49
--- /dev/null
+++ b/net-proxy/ufdbguard/files/ufdbguard.initd
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+# Copyright 1999-2007 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.1 2007/04/24 13:43:39 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_USER} ${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"
+}