ts3server 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. # Teamspeak 3
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://gameservermanagers.com
  6. version="040715"
  7. #### Variables ####
  8. # Notification Email
  9. # (on|off)
  10. emailnotification="off"
  11. email="email@example.com"
  12. # Start Variables
  13. updateonstart="off"
  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. fi
  52. source "${rootdir}/functions/${functionfile}"
  53. }
  54. fn_functions(){
  55. # Functions are defined in fn_functions.
  56. functionfile="${FUNCNAME}"
  57. fn_runfunction
  58. }
  59. fn_functions
  60. getopt=$1
  61. fn_getopt