Results 1 to 4 of 4
Thread: Start script..
-
27-08-2002, 01:18 #1
Start script..
Hi... not sure how useful you will find this but i've re-writen the start script
.. see below:
It has four modes start/stop/check/restart (restart does work properly yet..)
#rc.tss: Runs TeamSpeak Server #Modified NitroSniper 27/08/02
action=$1
###Edit these to suit you fancy!
HOME=/home/tss/tss2/
TSS_INI="tsserver2.ini"
TSS_LOG="tsserver2.log"
PID_FILE="tsserver2.pid"
####End of editable bit
cd $HOME
case "$action" in
'check')
#Used by crontab to check if TS is running
if test -r $PID_FILE
then
PID=`cat $PID_FILE`
if `kill -CHLD $PID >/dev/null 2>&1`
then
#TeamSpeak is hapily running now run away
exit 0
else
#TeamSpeak Server is not running! Auto-Restart
$0 start
exit 0
fi
fi
echo "TeamSpeak Server is not currently running! Start the server by typing ./tss.cmd start"
exit 0
;;
'start')
echo "NOTICE: Starting TeamSpeak Server..."
./tss -INI=$HOME/$TSS_INI -LOG=$HOME/$TSS_LOG -PID=$HOME/$PID_FILE
exit 0
;;
'stop')
if test -r $PID_FILE
then
PID=`cat $PID_FILE`
if `kill -CHLD $PID >/dev/null 2>&1`
then
kill -TERM $PID
rm $HOME/$PID_FILE
echo "NOTICE: TeamSpeak Server PID:$PID has been shutdown"
else
echo "NOTICE: TeamSpeak Server is already stopped!"
fi
else
echo "NOTICE: TeamSpeak Server is already stopped!"
fi
exit 0
;;
'restart')
if test -r $PID_FILE
then
PID=`cat $PID_FILE`
if `kill -CHLD $PID >/dev/null 2>&1`
then
$0 stop && $0 start || return=$rc_failed
else
echo "ERROR: TeamSpeak Server is not running! [PID NOT RUNNING] Try using: ./tss.cmd start"
fi
else
echo "ERROR: TeamSpeak Server is not running! [PID FILE NOT FOUND] Try using: ./tss.cmd start"
fi
exit 0
;;
*)
echo "Usage: $0 {start/stop/restart/check}"
esac
exit 0
-NitroSniper
Ps. Good job on v2.0 .. its bit buggy be we love it!
-
27-08-2002, 06:41 #2
-= TeamSpeak User =-
- Join Date
- Aug 2002
- Location
- NL
- Posts
- 28
You forgot just 1 thing: there's also a server.db running

haven't found the official commandswitch yet, but I've narrowed it down to useing '--DB=$home/$DB_FILE'
-
27-08-2002, 07:02 #3
-= TeamSpeak User =-
- Join Date
- Aug 2002
- Location
- NL
- Posts
- 28
Patched version of Niels' script:
This runs with the log/ini/db/pid file in the old tss1 style. In /var/log/tss2/
why did I replace the "kill -TERM `cat /var/log/tss2/tsserver2.pid` ??Code:#! /bin/bash # Copyright (c) 2002 TeamSpeak team All rights reserved. # # Author: Niels Werensteijn 2002 # case "$1" in start) ./server_linux -INI=/var/log/tss2/server.ini -DB=/var/log/tss2/server.db -LOG=/var/log/tss2/server.log -PID=/var/log/tss2/tsserver2.pid ;; stop) killall -9 server_linux ;; restart) $0 stop && $0 start || return=$rc_failed ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit 0
just because the webserver part is too easilly borked and it's, for now, the only easy way to shutdown the server.
-
27-08-2002, 07:12 #4
-= TeamSpeak User =-
- Join Date
- Aug 2002
- Location
- NL
- Posts
- 28
forget my 2 posts for now...
the option -DB leads to a broken server.db
You won't brake the file itself, but teamspeak2 server will not be able to log in to anything anymore that way.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
My startup script
By Lippy001 in forum [TeamSpeak 2] Server SupportReplies: 0Last Post: 24-02-2009, 12:32 -
please help someone
By theundead67 in forum [TeamSpeak 2] Server SupportReplies: 59Last Post: 31-03-2007, 04:53 -
Server Start Script issues
By spencerjw in forum [TeamSpeak 2] Server SupportReplies: 7Last Post: 23-02-2006, 19:06 -
Where Can i find ts server START SCRIPT
By mooreh in forum [TeamSpeak 2] Server SupportReplies: 3Last Post: 01-03-2005, 22:14 -
Start stop script for TeamSpeak daemon (init)
By Cybernaut in forum [TeamSpeak 2] Server SupportReplies: 2Last Post: 11-11-2004, 17:07



Reply With Quote