roserver 2.3 KB

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