#!/bin/sh
#
# /etc/init.d/tntnet
#
#     tntnet startscript
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
# 
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
# UnitedLinux/SUSE/Novell based Linux distributions. If you want to base your
# script on this template and ensure that it works on non UL based LSB 
# compliant Linux distributions, you either have to provide the rc.status
# functions from UL or change the script to work without them.
# See skeleton.compat for a template that works with other distros as well.
#
### BEGIN INIT INFO
# Provides:          tntnet
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Tntnet httpd
# Description:       Tntnet is a web application server for web applications written in C++
### END INIT INFO

TNTBIN_BIN=/usr/bin/tntnet

#
# load the configuration
#
test -s /etc/rc.status && . /etc/rc.status && rc_reset

case "$1" in
	start)
		echo -n "Starting tntnet "
		/sbin/startproc $TNTNET_BIN
		rc_status -v
		;;

	stop)
		echo -n "Shutting down tntnet "
		/sbin/killproc -TERM $TNTNET_BIN
		rc_status -v
		;;

	restart)
		$0 stop
		$0 start
		;;

	reload)
		echo -n "Reload service tntnet "
		/sbin/killproc -HUP $TNTNET_BIN
		rc_status -v
		;;

	status)
		/sbin/checkproc $TNTNET_BIN
		rc_status -v
		;;

	*)
		echo "Usage: $0 start|stop|restart|status"
		exit 1
		;;
esac


# Inform the caller not only verbosely and set an exit status.
rc_exit
