#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/sguil-server/files/sguild.initd,v 1.1 2005/10/08 14:01:29 strerror Exp $ [ -z "${CONF}" ] && CONF="/etc/sguil/sguild.conf" [ -z "${AUTOCAT}" ] && AUTOCAT="/etc/sguil/autocat.conf" [ -z "${QUERIES}" ] && QUERIES="/etc/sguil/sguild.queries" [ -z "${USERS}" ] && USERS="/etc/sguil/sguild.users" [ -z "${ACCESS}" ] && AUTOCAT="/etc/sguil/sguild.access" SGUILD_OPTS="-D -c ${CONF} -u ${USERS} -A ${ACCESS}" [ -n "${OPENSSLPATH}" ] && SGUILD_OPTS="${SGUILD_OPTS} -o -C ${OPENSSLPATH}" depend() { need net use mysql } checkconfig() { [ -f "${CONF}" ] || return 1 [ -f "${AUTOCAT}" ] || return 1 [ -f "${QUERIES}" ] || return 1 [ -f "${USERS}" ] || return 1 [ -f "${ACCESS}" ] || return 1 if [ -n "${OPENSSLPATH}" ]; then [ -f "${OPENSSLPATH}/sguild.key" ] || return 1 [ -f "${OPENSSLPATH}/sguild.pem" ] || return 1 fi } start() { checkconfig || return 1 ebegin "Starting sguild" start-stop-daemon --start --quiet -c sguil --exec /usr/bin/sguild \ -- ${SGUILD_OPTS} ${EXTRA_SGUILD_OPTS} -D -P /var/run/sguil/sguild.pid eend $? } stop() { ebegin "Stopping sguild" start-stop-daemon --stop --quiet --pidfile /var/run/sguil/sguild.pid eend $? }