ut99server 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/bash
  2. # Unreal Tournament 99
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://danielgibbs.co.uk
  6. # Version: 070215
  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. servercfgdir="${systemdir}"
  32. servercfg="${servicename}.ini"
  33. servercfgfullpath="${servercfgdir}/${servercfg}"
  34. compressedmapsdir="${rootdir}/Maps-Compressed"
  35. defaultcfg="${systemdir}/Default.ini"
  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 --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  58. chmod +x "${functionfile}"
  59. cd "${rootdir}"
  60. sleep 1
  61. fi
  62. source "${rootdir}/functions/${functionfile}"
  63. }
  64. fn_functions(){
  65. # Functions are defined in fn_functions.
  66. functionfile="${FUNCNAME}"
  67. fn_runfunction
  68. }
  69. fn_functions
  70. getopt=$1
  71. fn_getopt