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="040715"
  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. ip="0.0.0.0"
  18. updateonstart="no"
  19. fn_parms(){
  20. parms="-netlog -ip=${ip} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods}"
  21. }
  22. # ARMA 3 Modules
  23. # add mods with relative paths:
  24. # mods/\@CBA_A3\;
  25. # or several mods as:
  26. # mods/\@CBA_A3\;mods/\@task_force_radio
  27. # and chmod modules directories to 775
  28. mods=""
  29. #### Advanced Variables ####
  30. # Steam
  31. # Stable
  32. appid="233780"
  33. # Development
  34. # appid="233780 -beta development"
  35. # Server Details
  36. servicename="arma3-server"
  37. gamename="ARMA 3"
  38. engine="realvirtuality"
  39. # Directories
  40. rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  41. selfname="$(basename $0)"
  42. lockselfname=".${servicename}.lock"
  43. filesdir="${rootdir}/serverfiles"
  44. systemdir="${filesdir}"
  45. executabledir="${filesdir}"
  46. executable="./arma3server"
  47. servercfg="${servicename}.server.cfg"
  48. networkcfg="${servicename}.network.cfg"
  49. servercfgdir="${systemdir}/cfg"
  50. servercfgfullpath="${servercfgdir}/${servercfg}"
  51. networkcfgfullpath="${servercfgdir}/${networkcfg}"
  52. servercfgdefault="${servercfgdir}/lgsm-default.server.cfg"
  53. networkcfgdefault="${servercfgdir}/lgsm-default.network.cfg"
  54. backupdir="${rootdir}/backups"
  55. # Logging
  56. logdays="7"
  57. #gamelogdir="" # No server logs available
  58. scriptlogdir="${rootdir}/log/script"
  59. consolelogdir="${rootdir}/log/console"
  60. scriptlog="${scriptlogdir}/${servicename}-script.log"
  61. consolelog="${consolelogdir}/${servicename}-console.log"
  62. emaillog="${scriptlogdir}/${servicename}-email.log"
  63. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  64. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  65. ##### Script #####
  66. # Do not edit
  67. fn_runfunction(){
  68. # Functions are downloaded and run with this function
  69. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  70. cd "${rootdir}"
  71. if [ ! -d "functions" ]; then
  72. mkdir functions
  73. fi
  74. cd functions
  75. echo -e " loading ${functionfile}...\c"
  76. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  77. chmod +x "${functionfile}"
  78. cd "${rootdir}"
  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