Advertisement
Guest User

Untitled

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