Results 1 to 3 of 3
-
20-12-2009, 22:28 #1
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 2
[outdated] Init Script (Modified the old TS2 Server Script)
Edit by mod
Please don't use this outdated script anymore! The script got an overhaul long time ago.
Please use the minimal or startscript instead
Save it as /etc/init.d/teamspeak3, customize your path, user and binary settings, make the file executable (chmod +x).#! /bin/bash
# ##################
# Initscript updated for Teamspeak3 2009-12-20
# ##################
#
# Teamspeak2 Init script Copyright (c) 2004 TeamSpeak team All rights reserved.
#
# Author: pwk.linuxfan 2004
#
###########################
# SETTINGS
###########################
# Make sure the folder and all files belong to the user!
# Furthermore the token in /dev/shm/ shall be accessible by the user below.
USER=teamspeak3
DIR=/opt/teamspeak3
BINARY=ts3server_linux_x86
#BINARY=ts3server_linux_amd64
###########################
# END SETTINGS
###########################
cd $DIR
case "$1" in
start)
if [ "" != "`ps aux | grep $BINARY | grep -v grep | awk '{print $2}'`" ]; then
echo "The Teamspeak3 Server seems to be already running... ?";
exit 1
else
if [ "$USER" = "root" ]; then
echo WARNING ! For security reasons we advise: DO NOT RUN THE SERVER AS ROOT
for c in $(seq 1 10); do
echo -n "!"
sleep 1
done
echo !
fi
echo "starting the teamspeak3 server"
if [ -e $BINARY ]; then
if [ ! -x $BINARY ]; then
echo "$BINARY is not executable, trying to set it"
chmod u+x $BINARY
fi
if [ -x $BINARY ]; then
su -c "cd $DIR && $DIR/$BINARY" - $USER &>/dev/null &
else
echo "$BINARY is not executable, fix this"
exit 4
fi
else
echo "Couldnt find $BINARY"
exit 5
fi
fi
;;
stop)
if [ "" != "`ps aux | grep $BINARY | grep -v grep | awk '{print $2}'`" ]; then
echo -n "stopping the teamspeak3 server"
if ( kill -TERM `ps aux | grep $BINARY | grep -v grep | awk '{print $2}'` ); then
#echo "Killing Teamspeak"
for c in $(seq 1 300); do
if [ "" != "`ps aux | grep $BINARY | grep -v grep | awk '{print $2}'`" ]; then
echo -n "."
sleep 1
fi
done
fi
if [ "" != "`ps aux | grep $BINARY | grep -v grep | awk '{print $2}'`" ]; then
echo "server does not shutdown cleanly - killing"
kill -KILL "`ps aux | grep $BINARY | grep -v grep | awk '{print $2}'`"
sleep 5
else
echo "done"
fi
else
echo "could not find running server ?"
exit 7
fi
;;
restart)
$0 stop && $0 start || exit 1
;;
status)
if [ "" != "`ps aux | grep $BINARY | grep -v grep | awk '{print $2}'`" ]; then
echo "the server seems to be running"
exit 0
else
echo "the server seems to be stopped"
exit 3
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 2
esac
exit 0
The script is a modified version of the TS2 startscript ready for TS3.Last edited by florian_fr40; 08-11-2011 at 15:59.
-
21-12-2009, 02:16 #2
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Netherlands
- Posts
- 7
Going to give it a shot tomorrow

Will let you know the results, got the stuff working more then a day now without probs on fedora 10 x64, just want to know if it works or not so they could include it in the next release.
Better way to do
As root cd to /etc/init.d and then copy an existing script like "cp sshd teamspeak3" this will simplify the permissions issue with the file. Empty that file via putty or telnet and copy paste the above stuff in it.
Then you just need to save it.
My favo to open is "nano teamspeak3" to edit it, easier to use then vi
, after adding the new stuff, just CTRL X and approve to close. and you have a file you can tricker that works.
-
21-12-2009, 08:32 #3
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 12
This script is not capable of starting the server with any parameters and it will also not use any ini file.
In order to start the server with an Ini-File and individual parameters I modified this line:
toCode:su -c "cd $DIR && $DIR/$BINARY" - $USER &>/dev/null &
Now the server uses the parameters from ts3server.ini within the installation directory. Refer to the server_quickstart.txt on how to create an ini file.Code:su -c "cd $DIR && $DIR/$BINARY inifile=ts3server.ini" - $USER &>/dev/null &
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
HOWTO: modified start script for auto starting on server boot (ts3 as non-root user)
By fratzi in forum Linux / FreeBSDReplies: 1Last Post: 07-04-2010, 14:34 -
Init script for new ts3server_startscript.sh?
By Jimi` in forum Linux / FreeBSDReplies: 2Last Post: 27-02-2010, 17:19 -
Server init script for SuSe distribution >= 9.0
By Deepthought42 in forum [TeamSpeak 2] Server SupportReplies: 1Last Post: 09-05-2006, 15:41 -
Init-script for Linuxversion of the server
By vondel in forum [TeamSpeak 2] Addons & ScriptsReplies: 0Last Post: 15-02-2004, 00:13 -
My modified Start-up script
By Jovi in forum [TeamSpeak 2] Server SupportReplies: 17Last Post: 02-09-2002, 19:56


Reply With Quote