arma3server 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. # ARMA 3
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Contributor: Scarsz
  6. # Website: http://danielgibbs.co.uk
  7. # Version: 210115
  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. # Server IP
  17. ip="0.0.0.0"
  18. fn_parms(){
  19. parms="-netlog -ip=${ip} -config=${servercfg} -mod=${mods}"
  20. }
  21. #### Advanced Variables ####
  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. # Steam
  30. appid="233780"
  31. # Server Details
  32. servicename="arma3-server"
  33. gamename="ARMA 3"
  34. engine="realvirtuality"
  35. # Directories
  36. rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
  37. selfname="$(basename $0)"
  38. lockselfname=".${servicename}.lock"
  39. filesdir="${rootdir}/serverfiles"
  40. systemdir="${filesdir}"
  41. executabledir="${filesdir}"
  42. executable="./arma3server"
  43. servercfgdir="${systemdir}"
  44. servercfg="${servicename}.cfg"
  45. servercfgfullpath="${servercfgdir}/${servercfg}"
  46. backupdir="${rootdir}/backups"
  47. # Logging
  48. logdays="7"
  49. #gamelogdir="" # No server logs available
  50. scriptlogdir="${rootdir}/log/script"
  51. consolelogdir="${rootdir}/log/console"
  52. scriptlog="${scriptlogdir}/${servicename}-script.log"
  53. consolelog="${consolelogdir}/${servicename}-console.log"
  54. emaillog="${scriptlogdir}/${servicename}-email.log"
  55. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  56. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  57. ##### Script #####
  58. # Do not edit
  59. fn_runfunction(){
  60. # Functions are downloaded and run with this function
  61. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  62. cd "${rootdir}"
  63. if [ ! -d "functions" ]; then
  64. mkdir functions
  65. fi
  66. cd functions
  67. echo -e "loading ${functionfile}...\c"
  68. wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  69. chmod +x "${functionfile}"
  70. cd "${rootdir}"
  71. sleep 1
  72. fi
  73. source "${rootdir}/functions/${functionfile}"
  74. }
  75. fn_functions(){
  76. # Functions are defined in fn_functions.
  77. functionfile="${FUNCNAME}"
  78. fn_runfunction
  79. }
  80. fn_functions
  81. getopt=$1
  82. fn_getopt