Results 1 to 3 of 3
Thread: An addional startup script.
-
27-12-2006, 23:59 #1
-= TeamSpeak User =-
- Join Date
- Jun 2006
- Location
- Denmark
- Posts
- 4
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
-
01-01-2007, 13:08 #2
-= TeamSpeak User =-
- Join Date
- Jun 2006
- Location
- Denmark
- Posts
- 4
Any got any trouble using this or something? Feedback please
-
08-06-2007, 19:54 #3
-= TeamSpeak User =-
- 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
-
Can't enter admistration or my server.
By TheSavior in forum [TeamSpeak 2] Server SupportReplies: 12Last Post: 10-06-2006, 22:48 -
Improved SuSE startup script
By tizzyd in forum [TeamSpeak 2] Addons & ScriptsReplies: 2Last Post: 04-10-2004, 11:11 -
Server startup script for Red Hat and Fedora (Code provided).
By deragon in forum [TeamSpeak 2] General QuestionsReplies: 0Last Post: 14-02-2004, 22:45 -
Startup script NOT AS ROOT
By Heavenstrash in forum [TeamSpeak 2] Server SupportReplies: 10Last Post: 05-07-2003, 05:45


Reply With Quote