Community Forums Today's Posts     Member List     Archive    
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Location
    Denmark
    Posts
    4

    Lightbulb An addional startup script.

    Hello.
    I had an idea about beeing able to start and stop my Teamspeak 2 server thru init.d scripts, so I made a little shell script to help me do that, the script will use 'sudo' command to start up the teamspeak 2 server as a defined user. All you have to do is edit the variables in the top (I made comments) and have sudo installed.

    NOTE: This requires you have the 'sudo' command and Teamspeak2 (with teamspeak2-server_startscript) installed.

    Installation on a Debian system:
    1) Copy the code into /etc/init.d/teamspeak (Make sure to edit the 3 variables in the top)
    2) Make the script executeable with 'chmod +x /etc/init.d/teamspeak' (without quotes)
    3) Run 'cd /etc/init.d/' (without quotes)
    4) Run 'update-rc.d teamspeak defaults'

    That should be it. Enjoy.

    Code:
    #!/bin/sh
     
    ##### Teamspeak directory (NO TAILING /)
    TSD="/home/deejay/ts2"
     
    ##### User to start teamspeak2 with.
    TSU="deejay"
     
    #### ts2 start script (teamspeak2-server_startscript is default in the linux packages)
    TSCRIPT="teamspeak2-server_startscript"
      
    ###############################################
    # Code bellow, feel free to edit if you want. #
    ###############################################
     
    if [ $UID != "0" ]
    then
            echo "This start script can only be run as root!"
            exit 1
    fi
    CUR="$PWD"
    case "$1" in
    start)
            cd $TSD
            sudo -u $TSU ./$TSCRIPT start
            cd $CUR
    ;;
    stop)
            cd $TSD
            sudo -u $TSU ./$TSCRIPT stop
            cd $CUR
    ;;
    *)
    echo "Usage: /etc/init.d/teamspeak2 {start|stop}"
    exit 1
    esac

  2. #2
    Join Date
    Jun 2006
    Location
    Denmark
    Posts
    4
    Any got any trouble using this or something? Feedback please

  3. #3
    Join Date
    Jun 2007
    Location
    Netherlands, Groningen
    Posts
    1

    Nice

    Very Nice Script, i was looking for something like this... good job

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can't enter admistration or my server.
    By TheSavior in forum [TeamSpeak 2] Server Support
    Replies: 12
    Last Post: 10-06-2006, 22:48
  2. Improved SuSE startup script
    By tizzyd in forum [TeamSpeak 2] Addons & Scripts
    Replies: 2
    Last Post: 04-10-2004, 11:11
  3. Server startup script for Red Hat and Fedora (Code provided).
    By deragon in forum [TeamSpeak 2] General Questions
    Replies: 0
    Last Post: 14-02-2004, 22:45
  4. Startup script NOT AS ROOT
    By Heavenstrash in forum [TeamSpeak 2] Server Support
    Replies: 10
    Last Post: 05-07-2003, 05:45

Posting Permissions

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