Community Forums Today's Posts     Member List     Archive    
Results 1 to 4 of 4

Thread: Start script..

  1. #1
    Join Date
    Aug 2002
    Location
    Brighton, UK
    Posts
    21

    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!

  2. #2
    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'



  3. #3
    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/

    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.

  4. #4
    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

  1. My startup script
    By Lippy001 in forum [TeamSpeak 2] Server Support
    Replies: 0
    Last Post: 24-02-2009, 12:32
  2. please help someone
    By theundead67 in forum [TeamSpeak 2] Server Support
    Replies: 59
    Last Post: 31-03-2007, 04:53
  3. Server Start Script issues
    By spencerjw in forum [TeamSpeak 2] Server Support
    Replies: 7
    Last Post: 23-02-2006, 19:06
  4. Where Can i find ts server START SCRIPT
    By mooreh in forum [TeamSpeak 2] Server Support
    Replies: 3
    Last Post: 01-03-2005, 22:14
  5. Start stop script for TeamSpeak daemon (init)
    By Cybernaut in forum [TeamSpeak 2] Server Support
    Replies: 2
    Last Post: 11-11-2004, 17:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •