#! /bin/sh # TeamSpeak Server Auto-Start. # Made by Olof, 2007. # Choose the folder and the user that should run it. USER=teamspeak DIR=/home/teamspeak/tss2_rc2 # Carry out specific functions when asked to by the system. case "$1" in start) echo "Starting the TeamSpeak Server" su $USER -c "$DIR/server_linux -PID=tsserver2.pid" ;; stop) echo "Stopping the TeamSpeak Server" kill -KILL `cat $DIR/tsserver2.pid` ;; status) if [ -e $DIR/tsserver2.pid ]; then echo "The TeamSpeak Voice server is running." exit 0 else echo "The TeamSpeak Voice server is stopped." exit 0 fi ;; *) echo "Usage: /etc/init.d/tsserver {start|stop|status}" exit 1 ;; esac exit 0