#! /bin/sh

#
# Generic boot-time start up script for vserver(8).
#
# Make sure the vserver binary is found within the path below.
#

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"

#
# The location of the process-ID file. If you use an alternate vserver
# base directory, make sure to change this too.
#

pidfile="/usr/local/etc/vchat/vserver.pid"

#
# Put any additional commandline qualifiers you may need into "flags".
# See vserver(8) for a detailed description of supported qualifiers.
#

flags=""

# --

case $1 in

	start)		echo "Starting VChat conference server"
			vserver ${flags} &
			;;

	stop)		if [ -f ${pidfile} ]; then
				echo "Stopping VChat conference server"
				kill `cat ${pidfile}`
			fi
			;;

	restart)	$0 stop
			sleep 2
			$0 start
			;;

	*)		echo "USAGE: $0 <start|stop|restart>"
			;;
esac
