4
0

arma3server 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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: 200315
  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. 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}/cfg"
  44. servercfg="${servicename}.server.cfg"
  45. networkcfg="${servicename}.network.cfg"
  46. servercfgfullpath="${servercfgdir}/${servercfg}"
  47. networkcfgfullpath="${servercfgdir}/${networkcfg}"
  48. backupdir="${rootdir}/backups"
  49. # Logging
  50. logdays="7"
  51. #gamelogdir="" # No server logs available
  52. scriptlogdir="${rootdir}/log/script"
  53. consolelogdir="${rootdir}/log/console"
  54. scriptlog="${scriptlogdir}/${servicename}-script.log"
  55. consolelog="${consolelogdir}/${servicename}-console.log"
  56. emaillog="${scriptlogdir}/${servicename}-email.log"
  57. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  58. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  59. ##### Script #####
  60. # Do not edit
  61. fn_runfunction(){
  62. # Functions are downloaded and run with this function
  63. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  64. cd "${rootdir}"
  65. if [ ! -d "functions" ]; then
  66. mkdir functions
  67. fi
  68. cd functions
  69. echo -e "loading ${functionfile}...\c"
  70. wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  71. chmod +x "${functionfile}"
  72. cd "${rootdir}"
  73. sleep 1
  74. fi
  75. source "${rootdir}/functions/${functionfile}"
  76. }
  77. fn_functions(){
  78. # Functions are defined in fn_functions.
  79. functionfile="${FUNCNAME}"
  80. fn_runfunction
  81. }
  82. fn_functions
  83. getopt=$1
  84. fn_getopt