# Startscript for Teamspeak 3 Server

## mbaecker

Hello there,

I wrote a little startup script for the new teamspeak3 server.

Here it is:

```

#!/sbin/runscript

#Teamspeak 3 startup script

#PATH=/sbin:/bin:/usr/sbin:/usr/bin:$DIR

#Server options

NAME="TeamSpeak 3 Server"

DESC="tss3"

DIR="/opt/teamspeak3-server"

BIN="ts3server"

PIDFILE="/var/run/teamspeak-server.pid"

PARAMS="inifile=ts3server.ini"

USER="teamspeak" # DO NOT USE root

GROUP="teamspeak" #  DO NOT USE root

### Do not edit anything below this line ###

start()

{

  ebegin "Starting $NAME"

  start-stop-daemon --start --chdir $DIR --exec $DIR/$BIN --make-pidfile --pidfile $PIDFILE  --chuid $USER:$GROUP -b -- $PARAMS

  chown $USER:$GROUP $PIDFILE

  eend 0

}

stop()

{

  ebegin "Stopping $NAME"

  start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --user $USER --exec $DIR/$BIN

  rm -rf $PIDFILE

  eend 0

}

restart()

{

  echo "Stopping $NAME"

  start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --user $USER --exec $DIR/$BIN

  rm -rf $PIDFILE

  sleep 1

  echo ...

  echo "Starting $NAME"

  start-stop-daemon --start --chdir $DIR --exec $DIR/$BIN --make-pidfile --pidfile $PIDFILE  --chuid $USER:$GROUP -b -- $PARAMS

  chown $USER:$GROUP $PIDFILE

}

```

There are some things to make it better. But for a first shot.   :Very Happy: 

Michael

----------

