Advertisement
SoulofSorrow

TS3 Crashrestart Script

Jul 27th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.90 KB | None | 0 0
  1. navigate into your teamspeak directory, for me it would be cd /home/ts3/teamspeak3-server_linux-amd64
  2.  
  3. type nano tscc.sh (ts crash checker)
  4.  
  5. Change the line ending with (*) to your needs and delete the (*) afterwards
  6.  
  7. paste the code below (if you use 32bit, change the ts3server_linux_amd64 to 32)
  8.    
  9.    
  10.  
  11. Code:
  12.  
  13. #!/bin/bash
  14.  
  15. TEAMSPEAK=`ps ax | grep ts3server_linux_amd64 | grep -v grep | wc -l`
  16. if [ $TEAMSPEAK -eq 1 ]
  17. then
  18. exit
  19. else
  20. /home/ts3/teamspeak3-server_linux-amd64/./ts3server_startscript.sh start (*)
  21. fi
  22.  
  23.  
  24.  
  25.  
  26.  
  27. save the file
  28.  
  29. type chmod +x tscc.sh
  30.  
  31. type crontab -e
  32.  
  33. navigate to the bottom of the file
  34.  
  35. type */2 * * * * /home/ts3/teamspeak3-server_linux-amd64/./tscc.sh (change the path to your needs. You may change the time, also)
  36.  
  37. exit with CTRL-X
  38.  
  39. You are done! The script will check every two minutes, whether your ts-server is running, if not.. it will restart it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement