Advertisement
Guest User

lgsm cfg

a guest
Nov 26th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. #!/bin/bash
  2. # ARMA 3
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Contributor: Scarsz
  6. # Website: https://gameservermanagers.com
  7. if [ -f ".dev-debug" ]; then
  8. exec 5>dev-debug.log
  9. BASH_XTRACEFD="5"
  10. set -x
  11. fi
  12.  
  13. version="211016"
  14.  
  15. #### Variables ####
  16.  
  17. # Notification Alerts
  18. # (on|off)
  19.  
  20. # Email
  21. emailalert="on"
  22. email=""
  23. emailfrom=""
  24.  
  25. # Pushbullet
  26. # https://www.pushbullet.com/#settings
  27. pushbulletalert="off"
  28. pushbullettoken="accesstoken"
  29.  
  30. # Steam login
  31. steamuser="STEAM LOGIN"
  32. steampass="STEAM PASS"
  33.  
  34. # Start Variables
  35. ip="MY IP ADDRESS"
  36. port="2302"
  37. updateonstart="off"
  38.  
  39. fn_parms(){
  40. parms="-netlog -ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory"
  41. }
  42.  
  43. # ARMA 3 Modules
  44. # add mods with relative paths:
  45. # mods/@cba_a3
  46. # to load the "Community Base Addons v3" module found in the
  47. # directory serverfiles/mods/@cba_a3. Load several mods as:
  48. # mods="mods/@ace\;mods/@acex\;mods/@cba_a3"
  49. mods=""
  50.  
  51. # Server-side Mods
  52. servermods="\@extDB2\;\@life_server"
  53.  
  54. # Path to BattlEye
  55. # leave empty for default
  56. bepath=""
  57.  
  58. #### Advanced Variables ####
  59.  
  60. # Github Branch Select
  61. # Allows for the use of different function files
  62. # from a different repo and/or branch.
  63. githubuser="GameServerManagers"
  64. githubrepo="LinuxGSM"
  65. githubbranch="master"
  66.  
  67. # Steam
  68. appid="233780"
  69.  
  70. # Steam App Branch Select
  71. # Allows to opt into the various Steam app branches. Default branch is "".
  72. # Example: "-beta development"
  73. branch=""
  74.  
  75. # Server Details
  76. servicename="arma3-server"
  77. gamename="ARMA 3"
  78. engine="realvirtuality"
  79.  
  80. # Directories
  81. rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
  82. selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  83. lockselfname=".${servicename}.lock"
  84. lgsmdir="${rootdir}/lgsm"
  85. functionsdir="${lgsmdir}/functions"
  86. libdir="${lgsmdir}/lib"
  87. tmpdir="${lgsmdir}/tmp"
  88. filesdir="${rootdir}/serverfiles"
  89. systemdir="${filesdir}"
  90. executabledir="${filesdir}"
  91. executable="./arma3server"
  92. servercfg="${servicename}.server.cfg"
  93. networkcfg="${servicename}.network.cfg"
  94. servercfgdefault="server.cfg"
  95. networkcfgdefault="network.cfg"
  96. servercfgdir="${systemdir}/cfg"
  97. servercfgfullpath="${servercfgdir}/${servercfg}"
  98. networkcfgfullpath="${servercfgdir}/${networkcfg}"
  99. backupdir="${rootdir}/backups"
  100.  
  101. # Logging
  102. logdays="7"
  103. #gamelogdir="" # No server logs available
  104. scriptlogdir="${rootdir}/log/script"
  105. consolelogdir="${rootdir}/log/console"
  106. consolelogging="on"
  107.  
  108. scriptlog="${scriptlogdir}/${servicename}-script.log"
  109. consolelog="${consolelogdir}/${servicename}-console.log"
  110. emaillog="${scriptlogdir}/${servicename}-email.log"
  111.  
  112. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  113. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  114.  
  115. ##### Script #####
  116. # Do not edit
  117.  
  118. # Fetches core_dl for file downloads
  119. fn_fetch_core_dl(){
  120. github_file_url_dir="lgsm/functions"
  121. github_file_url_name="${functionfile}"
  122. filedir="${functionsdir}"
  123. filename="${github_file_url_name}"
  124. githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
  125. # If the file is missing, then download
  126. if [ ! -f "${filedir}/${filename}" ]; then
  127. if [ ! -d "${filedir}" ]; then
  128. mkdir -p "${filedir}"
  129. fi
  130. echo -e " fetching ${filename}...\c"
  131. # Check curl exists and use available path
  132. curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
  133. for curlcmd in ${curlpaths}
  134. do
  135. if [ -x "${curlcmd}" ]; then
  136. break
  137. fi
  138. done
  139. # If curl exists download file
  140. if [ "$(basename ${curlcmd})" == "curl" ]; then
  141. curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
  142. if [ $? -ne 0 ]; then
  143. echo -e "\e[0;31mFAIL\e[0m\n"
  144. echo "${curlfetch}"
  145. echo -e "${githuburl}\n"
  146. exit 1
  147. else
  148. echo -e "\e[0;32mOK\e[0m"
  149. fi
  150. else
  151. echo -e "\e[0;31mFAIL\e[0m\n"
  152. echo "Curl is not installed!"
  153. echo -e ""
  154. exit 1
  155. fi
  156. chmod +x "${filedir}/${filename}"
  157. fi
  158. source "${filedir}/${filename}"
  159. }
  160.  
  161. core_dl.sh(){
  162. # Functions are defined in core_functions.sh.
  163. functionfile="${FUNCNAME}"
  164. fn_fetch_core_dl
  165. }
  166.  
  167. core_functions.sh(){
  168. # Functions are defined in core_functions.sh.
  169. functionfile="${FUNCNAME}"
  170. fn_fetch_core_dl
  171. }
  172.  
  173. core_dl.sh
  174. core_functions.sh
  175.  
  176. getopt=$1
  177. core_getopt.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement