#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/gonzui/files/gonzui,v 1.1 2005/04/12 16:07:17 matsuu Exp $

GONZUI_SERVER=/usr/bin/gonzui-server
GONZUIRC=/etc/gonzuirc
GONZUI_PIDFILE=/var/run/gonzui.pid

depend() {
    need net
}
 
checkconfig() {
    if [ ! -f "$GONZUIRC" ] ; then
	eerror "Please create $GONZUIRC"
	return 1
    fi
    return 0
}

start() {
    checkconfig || return $?
    ebegin "Starting gonzui"
    start-stop-daemon --start --quiet --exec $GONZUI_SERVER -- --daemon  --gonzuirc=$GONZUIRC --quiet
    eend $? "Failed to start gonzui"
}
 
stop() {
    ebegin "Stopping gonzui"
    start-stop-daemon --stop --quiet --pidfile $GONZUI_PIDFILE
    eend $? "Failed to stop gonzui"
}
