#! /bin/bash
# Copyright (c) 2001 TeamSpeak team   All rights reserved.
#
# Author: Niels Werensteijn 2001
#
# /etc/init.d/tss
#
### BEGIN INIT INFO
# Provides: tss      
# Required-Start: $network 
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:
# Description:   TeamSpeakServer 
### END INIT INFO

. /etc/rc.status

rc_reset

case "$1" in
    start)
        echo Starting TeamSpeak 2 Server Daemon  
        /home/tss/server_linux -PID=/home/tss/tss2.pid > /dev/null
	rc_status -v
        ;;
    stop)
        echo Stopping TeamSpeak Sercer Daemon
        kill -TERM `cat /home/tss/tss2.pid`
        rc_status -v
	;;
    restart)
	$0 stop && $0 start || return=$rc_failed
	;;
    *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac
exit 0
