diff options
Diffstat (limited to 'net-analyzer/sguil-server/files/sguild.initd')
-rwxr-xr-x | net-analyzer/sguil-server/files/sguild.initd | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/net-analyzer/sguil-server/files/sguild.initd b/net-analyzer/sguil-server/files/sguild.initd new file mode 100755 index 000000000000..11a1a94f7c91 --- /dev/null +++ b/net-analyzer/sguil-server/files/sguild.initd @@ -0,0 +1,45 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +[ -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 /run/sguild.pid + eend $? +} + +stop() { + ebegin "Stopping sguild" + start-stop-daemon --stop --quiet --pidfile /run/sguild.pid + eend $? +} |