arma3server 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. ip="0.0.0.0"
  18. updateonstart="no"
  19. fn_parms(){
  20. parms="-netlog -ip=${ip} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods}"
  21. }
  22. #### Advanced Variables ####
  23. # ARMA 3 Modules
  24. # add mods with relative paths:
  25. # mods/\@CBA_A3\;
  26. # or several mods as:
  27. # mods/\@CBA_A3\;mods/\@task_force_radio
  28. # and chmod modules directories to 775
  29. mods=""
  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. servercfgdir="${systemdir}/cfg"
  48. servercfg="${servicename}.server.cfg"
  49. networkcfg="${servicename}.network.cfg"
  50. servercfgfullpath="${servercfgdir}/${servercfg}"
  51. networkcfgfullpath="${servercfgdir}/${networkcfg}"
  52. backupdir="${rootdir}/backups"
  53. # Logging
  54. logdays="7"
  55. #gamelogdir="" # No server logs available
  56. scriptlogdir="${rootdir}/log/script"
  57. consolelogdir="${rootdir}/log/console"
  58. scriptlog="${scriptlogdir}/${servicename}-script.log"
  59. consolelog="${consolelogdir}/${servicename}-console.log"
  60. emaillog="${scriptlogdir}/${servicename}-email.log"
  61. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  62. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  63. ##### Script #####
  64. # Do not edit
  65. fn_runfunction(){
  66. # Functions are downloaded and run with this function
  67. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  68. cd "${rootdir}"
  69. if [ ! -d "functions" ]; then
  70. mkdir functions
  71. fi
  72. cd functions
  73. echo -e "loading ${functionfile}...\c"
  74. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  75. chmod +x "${functionfile}"
  76. cd "${rootdir}"
  77. sleep 1
  78. fi
  79. source "${rootdir}/functions/${functionfile}"
  80. }
  81. fn_functions(){
  82. # Functions are defined in fn_functions.
  83. functionfile="${FUNCNAME}"
  84. fn_runfunction
  85. }
  86. fn_functions
  87. getopt=$1
  88. fn_getopt