Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Startscript for Teamspeak 3 Server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mbaecker
n00b
n00b


Joined: 13 May 2003
Posts: 10

PostPosted: Mon Dec 28, 2009 11:21 am    Post subject: Startscript for Teamspeak 3 Server Reply with quote

Hello there,

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

Here it is:

Code:

#!/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. :D

Michael
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum