#!/sbin/runscript

# Gentoo Linux system service run script (init file) for Synchronet
#
# This file normally goes in your /etc/init.d directory
#
# $Id: sbbs.gentoo,v 1.2 2013/10/05 15:45:02 deuce Exp $

########################################
# Synchronet BBS Gentoo startup script #
########################################
# by access_d <axisd> Aug-31-2011

# You can edit these vars to meet your system configuration

SBBSDIR=/sbbs
export SBBSCTRL=$SBBSDIR/ctrl

PROG="$SBBSDIR/exec/sbbs"
PIDFILE="/var/run/sbbs.pid"

depend() {
	need localmount
	after bootmisc
}

start() {	
	ebegin "Starting SBBS services"
	start-stop-daemon --start --exec $PROG d --pidfile $PIDFILE
	eend $?
}

stop() {
	ebegin "Stopping SBBS services"
	start-stop-daemon --stop --exec $PROG --pidfile $PIDFILE
	eend $?
}

restart() {
	stop
	sleep 3
	start
}