ut2k4server 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/bash
  2. # Unreal Tournament 2004
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://gameservermanagers.com
  6. # Version: 030515
  7. #### Variables ####
  8. # Notification Email
  9. # (on|off)
  10. emailnotification="off"
  11. email="email@example.com"
  12. # Start Variables
  13. defaultmap="DM-Rankin"
  14. ip="0.0.0.0"
  15. fn_parms(){
  16. parms="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} log=${gamelog}"
  17. }
  18. # Server Details
  19. servicename="ut2k4-server"
  20. gamename="Unreal Tournament 2004"
  21. engine="unreal2"
  22. # Directories
  23. rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  24. selfname="$(basename $0)"
  25. lockselfname=".${servicename}.lock"
  26. filesdir="${rootdir}/serverfiles"
  27. systemdir="${filesdir}/System"
  28. executabledir="${systemdir}"
  29. executable="./ucc-bin"
  30. servercfgdir="${systemdir}"
  31. servercfg="${servicename}.ini"
  32. servercfgfullpath="${servercfgdir}/${servercfg}"
  33. compressedmapsdir="${rootdir}/Maps-Compressed"
  34. defaultcfg="${systemdir}/UT2004.ini"
  35. backupdir="${rootdir}/backups"
  36. # Logging
  37. logdays="7"
  38. gamelogdir="${rootdir}/log/server"
  39. scriptlogdir="${rootdir}/log/script"
  40. consolelogdir="${rootdir}/log/console"
  41. gamelog="${gamelogdir}/${servicename}-game.log"
  42. scriptlog="${scriptlogdir}/${servicename}-script.log"
  43. consolelog="${consolelogdir}/${servicename}-console.log"
  44. emaillog="${scriptlogdir}/${servicename}-email.log"
  45. gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%d-%m-%Y-%H-%M-%S').log"
  46. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  47. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  48. ##### Script #####
  49. # Do not edit
  50. fn_runfunction(){
  51. # Functions are downloaded and run with this function
  52. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  53. cd "${rootdir}"
  54. if [ ! -d "functions" ]; then
  55. mkdir functions
  56. fi
  57. cd functions
  58. echo -e "loading ${functionfile}...\c"
  59. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  60. chmod +x "${functionfile}"
  61. cd "${rootdir}"
  62. sleep 1
  63. fi
  64. source "${rootdir}/functions/${functionfile}"
  65. }
  66. fn_functions(){
  67. # Functions are defined in fn_functions.
  68. functionfile="${FUNCNAME}"
  69. fn_runfunction
  70. }
  71. fn_functions
  72. getopt=$1
  73. fn_getopt