English   German
  #1  
Old 27-08-2002, 02:18
NitroSniper NitroSniper is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Brighton, UK
Posts: 21
NitroSniper is on a distinguished road
Send a message via ICQ to NitroSniper
Cool 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!
Reply With Quote
  #2  
Old 27-08-2002, 07:41
Rrroot Rrroot is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: NL
Posts: 28
Rrroot is on a distinguished road
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'


Reply With Quote
  #3  
Old 27-08-2002, 08:02
Rrroot Rrroot is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: NL
Posts: 28
Rrroot is on a distinguished road
Patched version of Niels' script:
This runs with the log/ini/db/pid file in the old tss1 style. In /var/log/tss2/

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
why did I replace the "kill -TERM `cat /var/log/tss2/tsserver2.pid` ??
just because the webserver part is too easilly borked and it's, for now, the only easy way to shutdown the server.
Reply With Quote
  #4  
Old 27-08-2002, 08:12
Rrroot Rrroot is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: NL
Posts: 28
Rrroot is on a distinguished road
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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 17:05.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Add to Bookmarks   |   Printview   |   Contact Us   |   Legal Notices