Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. #!/bin/bash
  2. # ARK: Survivial Evolved
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: https://gameservermanagers.com
  6. if [ -f ".dev-debug" ]; then
  7. exec 5>dev-debug.log
  8. BASH_XTRACEFD="5"
  9. set -x
  10. fi
  11.  
  12. version="160916"
  13.  
  14. #### Variables ####
  15.  
  16. # Notification Alerts
  17. # (on|off)
  18.  
  19. # Email
  20. emailalert="off"
  21. email="email@example.com"
  22. #emailfrom="email@example.com"
  23.  
  24. # Pushbullet
  25. # https://www.pushbullet.com/#settings
  26. pushbulletalert="off"
  27. pushbullettoken="accesstoken"
  28.  
  29. # Steam login
  30. steamuser="anonymous"
  31. steampass=""
  32.  
  33. # Start Variables
  34. servername="[PvPvE]Le Sanctuaire des Titans"
  35. port="7777"
  36. queryport="27015"
  37. rconport="32330"
  38. rconpassword="" # Set to enable rcon
  39. maxplayers="70"
  40. ip="149.202.88.18"
  41. updateonstart="off"
  42.  
  43. fn_parms(){
  44. parms="\"TheCenter?listen?GenericMod?ModId=679529026,601893934,731604991,631241063,708807240,655581765,764326117,558651608,642479298,520879363,479295136,525507438,516096294,538986229,539464369,510590313,600705968?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}\""
  45. }
  46.  
  47. #### Advanced Variables ####
  48.  
  49. # Github Branch Select
  50. # Allows for the use of different function files
  51. # from a different repo and/or branch.
  52. githubuser="GameServerManagers"
  53. githubrepo="LinuxGSM"
  54. githubbranch="master"
  55.  
  56. # Steam
  57. appid="376030"
  58.  
  59. # Steam App Branch Select
  60. # Allows to opt into the various Steam app branches. Default branch is "".
  61. # Example: "-beta beta"
  62. branch=""
  63.  
  64. # Server Details
  65. servicename="[PvPvE]Le Sanctuaire des Titans"
  66. gamename="ARK: Survivial Evolved"
  67. engine="unreal4"
  68.  
  69. # Directories
  70. rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
  71. selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  72. lockselfname=".${servicename}.lock"
  73. lgsmdir="${rootdir}/lgsm"
  74. functionsdir="${lgsmdir}/functions"
  75. libdir="${lgsmdir}/lib"
  76. tmpdir="${lgsmdir}/tmp"
  77. filesdir="${rootdir}/serverfiles"
  78. systemdir="${filesdir}/ShooterGame"
  79. executabledir="${systemdir}/Binaries/Linux"
  80. executable="./ShooterGameServer"
  81. servercfgdir="${systemdir}/Saved/Config/LinuxServer"
  82. servercfg="GameUserSettings.ini"
  83. servercfgfullpath="${servercfgdir}/${servercfg}"
  84. servercfgdefault="${servercfgdir}/lgsm-default.ini"
  85. backupdir="${rootdir}/backups"
  86.  
  87. # Logging
  88. logdays="7"
  89. gamelogdir="${systemdir}/logs"
  90. scriptlogdir="${rootdir}/log/script"
  91. consolelogdir="${rootdir}/log/console"
  92. consolelogging="on"
  93.  
  94. scriptlog="${scriptlogdir}/${servicename}-script.log"
  95. consolelog="${consolelogdir}/${servicename}-console.log"
  96. emaillog="${scriptlogdir}/${servicename}-email.log"
  97.  
  98. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  99. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  100.  
  101. ##### Script #####
  102. # Do not edit
  103.  
  104. # Fetches core_dl for file downloads
  105. fn_fetch_core_dl(){
  106. github_file_url_dir="lgsm/functions"
  107. github_file_url_name="${functionfile}"
  108. filedir="${functionsdir}"
  109. filename="${github_file_url_name}"
  110. githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
  111. # If the file is missing, then download
  112. if [ ! -f "${filedir}/${filename}" ]; then
  113. if [ ! -d "${filedir}" ]; then
  114. mkdir -p "${filedir}"
  115. fi
  116. echo -e " fetching ${filename}...\c"
  117. # Check curl exists and use available path
  118. curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
  119. for curlcmd in ${curlpaths}
  120. do
  121. if [ -x "${curlcmd}" ]; then
  122. break
  123. fi
  124. done
  125. # If curl exists download file
  126. if [ "$(basename ${curlcmd})" == "curl" ]; then
  127. curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
  128. if [ $? -ne 0 ]; then
  129. echo -e "\e[0;31mFAIL\e[0m\n"
  130. echo "${curlfetch}"
  131. echo -e "${githuburl}\n"
  132. exit 1
  133. else
  134. echo -e "\e[0;32mOK\e[0m"
  135. fi
  136. else
  137. echo -e "\e[0;31mFAIL\e[0m\n"
  138. echo "Curl is not installed!"
  139. echo -e ""
  140. exit 1
  141. fi
  142. chmod +x "${filedir}/${filename}"
  143. fi
  144. source "${filedir}/${filename}"
  145. }
  146.  
  147. core_dl.sh(){
  148. # Functions are defined in core_functions.sh.
  149. functionfile="${FUNCNAME}"
  150. fn_fetch_core_dl
  151. }
  152.  
  153. core_functions.sh(){
  154. # Functions are defined in core_functions.sh.
  155. functionfile="${FUNCNAME}"
  156. fn_fetch_core_dl
  157. }
  158.  
  159. core_dl.sh
  160. core_functions.sh
  161.  
  162. getopt=$1
  163. core_getopt.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement