ts3server 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #!/bin/bash
  2. # Teamspeak 3
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://gameservermanagers.com
  6. version="010715"
  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. servercfg="${servicename}.ini"
  27. servercfgdir="${filesdir}"
  28. servercfgfullpath="${servercfgdir}/${servercfg}"
  29. backupdir="${rootdir}/backups"
  30. # Logging
  31. logdays="7"
  32. gamelogdir="${filesdir}/logs"
  33. scriptlogdir="${rootdir}/log/script"
  34. scriptlog="${scriptlogdir}/${servicename}-script.log"
  35. emaillog="${scriptlogdir}/${servicename}-email.log"
  36. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  37. ##### Script #####
  38. # Do not edit
  39. fn_runfunction(){
  40. # Functions are downloaded and run with this function
  41. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  42. cd "${rootdir}"
  43. if [ ! -d "functions" ]; then
  44. mkdir functions
  45. fi
  46. cd functions
  47. echo -e "loading ${functionfile}...\c"
  48. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  49. chmod +x "${functionfile}"
  50. cd "${rootdir}"
  51. sleep 1
  52. fi
  53. source "${rootdir}/functions/${functionfile}"
  54. }
  55. fn_functions(){
  56. # Functions are defined in fn_functions.
  57. functionfile="${FUNCNAME}"
  58. fn_runfunction
  59. }
  60. fn_functions
  61. getopt=$1
  62. fn_getopt