#! /bin/sh

#
# Boot-time start up script for vserver(8) on IRIX operating systems.
#
# Copy this script to '/etc/init.d/vserver' and then use 'chkconfig vserver on'
# to enable the VChat conference server being started at system boot time.
#
# 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)		if /etc/chkconfig vserver; then
				echo "Starting VChat conference server"
				vserver ${flags} &
			fi
			;;

	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


syntax highlighted by Code2HTML, v. 0.9.1