arma3server 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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: 240415
  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} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -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. # Stable
  31. appid="233780"
  32. # Development
  33. # appid="233780 -beta development"
  34. # Server Details
  35. servicename="arma3-server"
  36. gamename="ARMA 3"
  37. engine="realvirtuality"
  38. # Directories
  39. rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
  40. selfname="$(basename $0)"
  41. lockselfname=".${servicename}.lock"
  42. filesdir="${rootdir}/serverfiles"
  43. systemdir="${filesdir}"
  44. executabledir="${filesdir}"
  45. executable="./arma3server"
  46. servercfgdir="${systemdir}/cfg"
  47. servercfg="${servicename}.server.cfg"
  48. networkcfg="${servicename}.network.cfg"
  49. servercfgfullpath="${servercfgdir}/${servercfg}"
  50. networkcfgfullpath="${servercfgdir}/${networkcfg}"
  51. backupdir="${rootdir}/backups"
  52. # Logging
  53. logdays="7"
  54. #gamelogdir="" # No server logs available
  55. scriptlogdir="${rootdir}/log/script"
  56. consolelogdir="${rootdir}/log/console"
  57. scriptlog="${scriptlogdir}/${servicename}-script.log"
  58. consolelog="${consolelogdir}/${servicename}-console.log"
  59. emaillog="${scriptlogdir}/${servicename}-email.log"
  60. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  61. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  62. ##### Script #####
  63. # Do not edit
  64. fn_runfunction(){
  65. # Functions are downloaded and run with this function
  66. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  67. cd "${rootdir}"
  68. if [ ! -d "functions" ]; then
  69. mkdir functions
  70. fi
  71. cd functions
  72. echo -e "loading ${functionfile}...\c"
  73. wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  74. chmod +x "${functionfile}"
  75. cd "${rootdir}"
  76. sleep 1
  77. fi
  78. source "${rootdir}/functions/${functionfile}"
  79. }
  80. fn_functions(){
  81. # Functions are defined in fn_functions.
  82. functionfile="${FUNCNAME}"
  83. fn_runfunction
  84. }
  85. fn_functions
  86. getopt=$1
  87. fn_getopt