#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/omnievents/files/omnievents-init,v 1.1 2005/09/30 00:55:14 kloeri Exp $

depend() {
	need net
}

start() {
	test -n "$OMNIEVENTS_ALTERNATE" && OPT_ALTERNATE="-a $OMNIEVENTS_ALTERNATE"
	test -n "$OMNIEVENTS_NS_NAME" && OPT_NS_NAME="-N $OMNIEVENTS_NS_NAME"

	ebegin "Starting omniEvents"
	start-stop-daemon --start --quiet --exec /usr/sbin/omniEvents -- $OMNIEVENTS_OPTIONS -P /var/run/omniEvents.pid -l /var/lib/omniEvents -p $OMNIEVENTS_PORT $OPT_ALTERNATE $OPT_NS_NAME
	eend $?
}

stop() {
	ebegin "Stopping omniEvents"
	start-stop-daemon --stop --quiet --pidfile /var/run/omniEvents.pid
	eend $?
}
