ut99server 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/bash
  2. # Unreal Tournament 99
  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. defaultmap="DM-Deck16]["
  14. ip="0.0.0.0"
  15. fn_parms(){
  16. parms="server ${defaultmap}.unr ini=${servercfgfullpath}"
  17. }
  18. #### Advanced Variables ####
  19. # Server Details
  20. servicename="ut99-server"
  21. gamename="Unreal Tournament 99"
  22. engine="unreal"
  23. # Directories
  24. rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  25. selfname="$(basename $0)"
  26. lockselfname=".${servicename}.lock"
  27. filesdir="${rootdir}/serverfiles"
  28. systemdir="${filesdir}/System"
  29. executabledir="${systemdir}"
  30. executable="./ucc-bin"
  31. servercfg="${servicename}.ini"
  32. servercfgdir="${systemdir}"
  33. servercfgfullpath="${servercfgdir}/${servercfg}"
  34. servercfgdefault="${servercfgdir}/Default.ini"
  35. compressedmapsdir="${rootdir}/Maps-Compressed"
  36. backupdir="${rootdir}/backups"
  37. # Logging
  38. logdays="7"
  39. scriptlogdir="${rootdir}/log/script"
  40. consolelogdir="${rootdir}/log/console"
  41. scriptlog="${scriptlogdir}/${servicename}-script.log"
  42. consolelog="${consolelogdir}/${servicename}-console.log"
  43. emaillog="${scriptlogdir}/${servicename}-email.log"
  44. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  45. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  46. ##### Script #####
  47. # Do not edit
  48. fn_runfunction(){
  49. # Functions are downloaded and run with this function
  50. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  51. cd "${rootdir}"
  52. if [ ! -d "functions" ]; then
  53. mkdir functions
  54. fi
  55. cd functions
  56. echo -e " loading ${functionfile}...\c"
  57. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  58. chmod +x "${functionfile}"
  59. cd "${rootdir}"
  60. fi
  61. source "${rootdir}/functions/${functionfile}"
  62. }
  63. fn_functions(){
  64. # Functions are defined in fn_functions.
  65. functionfile="${FUNCNAME}"
  66. fn_runfunction
  67. }
  68. fn_functions
  69. getopt=$1
  70. fn_getopt