roserver 2.4 KB

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