ts3server 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/bash
  2. # Teamspeak 3
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://gameservermanagers.com
  6. # Version: 090515
  7. #### Variables ####
  8. # Notification Email
  9. # (on|off)
  10. emailnotification="off"
  11. email="email@example.com"
  12. # Start Variables
  13. updateonstart="no"
  14. # Server Details
  15. gamename="Teamspeak 3"
  16. servername="Teamspeak 3 Server"
  17. servicename="ts3-server"
  18. # Directories
  19. rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  20. selfname="$(basename $0)"
  21. lockselfname=".${servicename}.lock"
  22. filesdir="${rootdir}/serverfiles"
  23. systemdir="${filesdir}"
  24. executabledir="${filesdir}"
  25. executable="./ts3server_startscript.sh"
  26. servercfgdir="${filesdir}"
  27. servercfg="${servicename}.ini"
  28. servercfgfullpath="${servercfgdir}/${servercfg}"
  29. defaultcfg="${servercfgfullpath}"
  30. backupdir="${rootdir}/backups"
  31. # Logging
  32. logdays="7"
  33. gamelogdir="${filesdir}/logs"
  34. scriptlogdir="${rootdir}/log/script"
  35. scriptlog="${scriptlogdir}/${servicename}-script.log"
  36. emaillog="${scriptlogdir}/${servicename}-email.log"
  37. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  38. ##### Script #####
  39. # Do not edit
  40. fn_runfunction(){
  41. # Functions are downloaded and run with this function
  42. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  43. cd "${rootdir}"
  44. if [ ! -d "functions" ]; then
  45. mkdir functions
  46. fi
  47. cd functions
  48. echo -e "loading ${functionfile}...\c"
  49. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  50. chmod +x "${functionfile}"
  51. cd "${rootdir}"
  52. sleep 1
  53. fi
  54. source "${rootdir}/functions/${functionfile}"
  55. }
  56. fn_functions(){
  57. # Functions are defined in fn_functions.
  58. functionfile="${FUNCNAME}"
  59. fn_runfunction
  60. }
  61. fn_functions
  62. getopt=$1
  63. fn_getopt