Scripts for TS3 server | Autostart | AntiCrash

Supervisor

Administrator
Apr 27, 2015
1,863
2,546
335
Hey there,

as there are so many questions about scripts for Teamspeak 3 Servers.. I will provide some for you. They will include the AccountingServerEmulator for the TS3 crack, too. This scripts are tested in a linux environment, only!

So lets get started, follow the steps to install the scripts (I work with nano, if you don't have nano, install it):

Autostart script for ts3-server and the AccountingServerEmulator-Linux (sudo/root needed!):
  1. type cd /etc/init.d; nano teamspeak.sh
  2. paste the following code into the created file, change the marked lines (*) to your needs
    Code:
    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides:  teamspeak3
    # Required-Start:  $local_fs $network
    # Required-Stop:  $local_fs $network
    # Default-Start:  2 3 4 5
    # Default-Stop:  0 1 6
    # Short-Description:
    # Description:  Teamspeak 3 Server
    #
    ### END INIT INFO#!/bin/sh
    
    case "$1" in
    start)
    su ts3 -c "/home/ts3/teamspeak3-server_linux-amd64/./AccountingServerEmulator-Linux" (*)
    sleep 10
    su ts3 -c "/home/ts3/teamspeak3-server_linux-amd64/./ts3server_startscript.sh start" (*)
    ;;
    stop)
    su ts3 -c "/home/ts3/teamspeak3-server_linux-amd64/./ts3server_startscript.sh stop" (*)
    su ts3 -c "/home/ts3/teamspeak3-server_linux-amd64/./AccountingServerEmulator-Linux stop" (*)
    ;;
    *)
    echo "$0 (start|stop)"
    exit 1
    ;;
    esac
    exit 0
  3. save the file with Ctrl-x
  4. type chmod +x teamspeak.sh; update-rc.d teamspeak.sh defaults
  5. You are done! Everytime your server restarts, your ts server and your accounting server will start, too!

TS3 crash script:

  1. navigate into your teamspeak directory, for me it would be cd /home/ts3/teamspeak3-server_linux-amd64
  2. type nano tscc.sh (ts crash checker)
  3. Change the line ending with (*) to your needs and delete the (*) afterwards
  4. paste the code below (if you use 32bit, change the ts3server_linux_amd64 to 32)
    Code:
    #!/bin/bash
    
    TEAMSPEAK=`ps ax | grep ts3server_linux_amd64 | grep -v grep | wc -l`
    
    if [ $TEAMSPEAK -eq 1 ]
    then
    exit
    else
    /home/ts3/teamspeak3-server_linux-amd64/./ts3server_startscript.sh start (*)
    fi
  5. save the file
  6. type chmod +x tscc.sh
  7. type crontab -e
  8. navigate to the bottom of the file
  9. type */2 * * * * /home/ts3/teamspeak3-server_linux-amd64/./tscc.sh (change the path to your needs. You may change the time, also)
  10. exit with CTRL-X
  11. You are done! The script will check every two minutes, whether your ts-server is running, if not.. it will restart it.
TS3 AccountingServer Startscript:
Code:
#! /bin/bash
case "$(pidof AccountingServerEmulator-Linux | wc -w)" in
0) echo "Restarting AccountingServer: $(date)" >> /usr/teamspeak3/auto_log.txt
/usr/teamspeak3/AccountingServerEmulator-Linux &
;;
1) # all ok
;;
*) echo "Removed double AccountingServer: $(date)" >> /usr/teamspeak3/auto_log.txt
kill $(pidof AccountingServerEmulator-Linux | awk '{print $1}')
;;
esac
 
Last edited:

cananon1

Member
May 19, 2015
99
47
60
thanks

Edit
got it was on my end i derped it was in /teamspeak/ts3/..
 
Last edited:

crahd

Member
May 22, 2015
3
0
36
Thank you for add this Supervisor. One question;-) How add cracked ts3 on gametracker ? Its posibble ?
 

Supervisor

Administrator
Apr 27, 2015
1,863
2,546
335
sorry, I don't know that website, so I can't help you with that
 

crahd

Member
May 22, 2015
3
0
36
My bad ;)
http://www.gametracker.com/
When i try add my ts3 on base i see

Your server is firewalled.
Please turn off any firewall you have that may block scanning or whitelist the gametracker scanning IP addresses:
208.167.241.190
208.167.241.185
208.167.241.186
208.167.241.183
208.167.241.189
108.61.78.147
108.61.78.148
108.61.78.149
108.61.78.150

Its possible open this ports and add my server to whitelist gametracker ?
Thank you !
 

Supervisor

Administrator
Apr 27, 2015
1,863
2,546
335
Sorry, I just don't know that website and I don't know what it is about. But They told you what to do, simply put this ip-adresses in your whitelist of your firewall. For further questions, please ask in a linux forum (if your server uses linux) as this is not related to my scripts, but to your server firewall.
 

Zajao

Member
Jun 9, 2015
14
3
35
Hi!
On Debian 7x64 the TS3 crash script hasn't been working till I changed
Code:
./ts3server_startscript.sh start
to full path
Code:
/home/ts3/teamspeak3-server_linux-amd64/ts3server_startscript.sh start



Same thing on cron
Code:
* * * * * /home/ts3/teamspeak3-server_linux-amd64/tscc.sh

And I think the same crash script is needed for AccountingServerEmulator-Linux - because it crahes every 2-3 days. Causing the TS server to crash because of licence problems.
 

Supervisor

Administrator
Apr 27, 2015
1,863
2,546
335
Hi!
On Debian 7x64 the TS3 crash script hasn't been working till I changed
Code:
./ts3server_startscript.sh start
to full path
Code:
/home/ts3/teamspeak3-server_linux-amd64/ts3server_startscript.sh start
Ok, thx for the advice.. I'll change it :)
Just looked up my own scirpt, it says:
cd /home/ts3/teamspeak3-server_linux-amd64 ; ./ts3server_startscript.sh start
:p


And I think the same crash script is needed for AccountingServerEmulator-Linux - because it crahes every 2-3 days. Causing the TS server to crash because of licence problems.
Yeah, a user posted a script for this on the TS3-Crack Thread, I'll quote him in my post.
 

Sharc

Member
Aug 25, 2015
70
9
43
Sorry for my English :D

Add new user
adduser -disabled-login teamspeak3

Go to the folder the user teamspeak3
cd /home/teamspeak3

Install server crack
https://forum.r4p3.net/threads/teamspeak-server-crack-3-0-11-4-beta.290/

Grant rights to the user
chown -R teamspeak3:teamspeak3 teamspeak3

Run crontab
crontab -u teamspeak3 -e

Add to the bottom line
@reboot cd /home/teamspeak3/; sh ts3server_startscript.sh start
And save by pressing F2
 

Lucjan

Member
Sep 12, 2015
4
2
38
Make a file "check_ts3" and put:

#!/bin/bash

TEAMSPEAK=`ps ax | grep ts3server_linux_x86 | grep -v grep | wc -l`

if [ $TEAMSPEAK -eq 1 ]
then
exit
else
cd /home/TeamSpeak3 ; ./ts3server_startscript.sh start query_port=10011
fi

when we need add crontab -e

*/1 * * * * sh /home/TeamSpeak3/check_ts3 @reboot cd /home/TeamSpeak3 ; ./ts3server_startscript.sh start query_port=10011
 
Last edited:

OnkelHomie

Member
Nov 30, 2015
4
0
33
The script will check every two minutes, whether your ts-server is running, if not.. it will restart it. But not the AccountingEmulator
dc08cdadea415e09def5fb2fbd2084de.png


someone has a script to start the AccountingEmulator first and then the TS³ Server?

Like that:

Code:
#!/bin/bash

TEAMSPEAK=`ps ax | grep ts3server_linux_amd64 | grep -v grep | wc -l`

if [ $TEAMSPEAK -eq 1 ]
then
exit
else
/home/ts3/teamspeak3-server_linux-amd64/./ts3server_startscript.sh start (*)
fi
 

Hubele

Member
Feb 16, 2016
9
2
38
don't just post an error
(A)ctivate | (D)eactivate: A
./ts3crack_0530: line 260: crontab: command not found
./ts3crack_0530: line 263: crontab: command not found
Anticrash activated.
(A)ctivate or (D)eactivate the AccServer anticrash script?
(A)ctivate | (D)eactivate: A
./ts3crack_0530: line 280: crontab: command not found
./ts3crack_0530: line 283: crontab: command not found
Anticrash activated.
(A)ctivate or (D)eactivate the TSDNS server anticrash script?
If you are not sure about it, set it to Deactivate.
(A)ctivate | (D)eactivate: A
./ts3crack_0530: line 300: crontab: command not found
./ts3crack_0530: line 303: crontab: command not found
 

Alligatoras

Administrator
Mar 31, 2016
2,570
12
2,855
381
(A)ctivate | (D)eactivate: A
./ts3crack_0530: line 260: crontab: command not found
./ts3crack_0530: line 263: crontab: command not found
Anticrash activated.
(A)ctivate or (D)eactivate the AccServer anticrash script?
(A)ctivate | (D)eactivate: A
./ts3crack_0530: line 280: crontab: command not found
./ts3crack_0530: line 283: crontab: command not found
Anticrash activated.
(A)ctivate or (D)eactivate the TSDNS server anticrash script?
If you are not sure about it, set it to Deactivate.
(A)ctivate | (D)eactivate: A
./ts3crack_0530: line 300: crontab: command not found
./ts3crack_0530: line 303: crontab: command not found
that's probably becasue the crack's version now is: ts3crack_0529 and not ts3crack_0530
 

dedmen

TeamSpeak Developer
Contributor
Mar 28, 2016
530
583
157
Could you tell him what the correct answer is to this issue instead of telling him it's wrong?
i did... "crontab: command not found" the error is that the "crontab" command was not found... Which means he doesnt have cron installed.
 

Ginger

Member
Nov 7, 2016
9
1
38
Will this work for windows ts server?
i have downloaded the newest version of the ts crack. and it keeps shuting down after 2-3 hours ;(
 
Top