arma3server 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #!/bin/bash
  2. # ARMA 3
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Contributor: Scarsz
  6. # Website: http://gameservermanagers.com
  7. # Version: 090515
  8. #### Variables ####
  9. # Notification Email
  10. # (on|off)
  11. emailnotification="off"
  12. email="email@example.com"
  13. # Steam login
  14. steamuser="username"
  15. steampass="password"
  16. # Start Variables
  17. port="2302"
  18. ip="0.0.0.0"
  19. updateonstart="no"
  20. fn_parms(){
  21. parms="-netlog -ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods}"
  22. }
  23. #### Advanced Variables ####
  24. # ARMA 3 Modules
  25. # add mods with relative paths:
  26. # mods/\@CBA_A3\;
  27. # or several mods as:
  28. # mods/\@CBA_A3\;mods/\@task_force_radio
  29. # and chmod modules directories to 775
  30. mods=""
  31. # Steam
  32. # Stable
  33. appid="233780"
  34. # Development
  35. # appid="233780 -beta development"
  36. # Server Details
  37. servicename="arma3-server"
  38. gamename="ARMA 3"
  39. engine="realvirtuality"
  40. # Directories
  41. rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
  42. selfname="$(basename $0)"
  43. lockselfname=".${servicename}.lock"
  44. filesdir="${rootdir}/serverfiles"
  45. systemdir="${filesdir}"
  46. executabledir="${filesdir}"
  47. executable="./arma3server"
  48. servercfgdir="${systemdir}/cfg"
  49. servercfg="${servicename}.server.cfg"
  50. networkcfg="${servicename}.network.cfg"
  51. servercfgfullpath="${servercfgdir}/${servercfg}"
  52. networkcfgfullpath="${servercfgdir}/${networkcfg}"
  53. backupdir="${rootdir}/backups"
  54. # Logging
  55. logdays="7"
  56. #gamelogdir="" # No server logs available
  57. scriptlogdir="${rootdir}/log/script"
  58. consolelogdir="${rootdir}/log/console"
  59. scriptlog="${scriptlogdir}/${servicename}-script.log"
  60. consolelog="${consolelogdir}/${servicename}-console.log"
  61. emaillog="${scriptlogdir}/${servicename}-email.log"
  62. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  63. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  64. ##### Script #####
  65. # Do not edit
  66. fn_runfunction(){
  67. # Functions are downloaded and run with this function
  68. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  69. cd "${rootdir}"
  70. if [ ! -d "functions" ]; then
  71. mkdir functions
  72. fi
  73. cd functions
  74. echo -e "loading ${functionfile}...\c"
  75. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  76. chmod +x "${functionfile}"
  77. cd "${rootdir}"
  78. sleep 1
  79. fi
  80. source "${rootdir}/functions/${functionfile}"
  81. }
  82. fn_functions(){
  83. # Functions are defined in fn_functions.
  84. functionfile="${FUNCNAME}"
  85. fn_runfunction
  86. }
  87. fn_functions
  88. getopt=$1
  89. fn_getopt