arkserver 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/bash
  2. # ARK: Survivial Evolved
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://gameservermanagers.com
  6. # Version: 210615
  7. #### Variables ####
  8. # Notification Email
  9. # (on|off)
  10. emailnotification="off"
  11. email="email@example.com"
  12. # Steam login
  13. steamuser="anonymous"
  14. steampass=""
  15. # Start Variables
  16. defaultmap="de_dust2"
  17. maxplayers="16"
  18. port="27016"
  19. queryport="7779"
  20. serverpass="serverpassword"
  21. serveradminpass="adminpassword"
  22. ip="0.0.0.0"
  23. updateonstart="no"
  24. # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
  25. fn_parms(){
  26. parms="TheIsland?listen?SessionName=${servicename}?ServerAdminPassword=${serveradminpass}?ServerPassword=${serverpass}?QueryPort=${queryport}?Port=${port}?ServerAdminPassword=${serveradminpass} -server -log"
  27. }
  28. #### Advanced Variables ####
  29. # Steam
  30. appid="376030"
  31. # Server Details
  32. servicename="ark-server"
  33. gamename="ARK: Survivial Evolved"
  34. engine="unreal4"
  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}/ShooterGame"
  41. executabledir="${systemdir}/Binaries/Linux"
  42. executable="./ShooterGameServer"
  43. servercfgdir="${systemdir}/Saved/Config/LinuxServer/"
  44. servercfg="GameUserSettings.ini"
  45. servercfgfullpath="${servercfgdir}/${servercfg}"
  46. defaultcfg="${servercfgdir}/server.cfg"
  47. backupdir="${rootdir}/backups"
  48. # Logging
  49. logdays="7"
  50. gamelogdir="${systemdir}/logs"
  51. scriptlogdir="${rootdir}/log/script"
  52. consolelogdir="${rootdir}/log/console"
  53. scriptlog="${scriptlogdir}/${servicename}-script.log"
  54. consolelog="${consolelogdir}/${servicename}-console.log"
  55. emaillog="${scriptlogdir}/${servicename}-email.log"
  56. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  57. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  58. ##### Script #####
  59. # Do not edit
  60. fn_runfunction(){
  61. # Functions are downloaded and run with this function
  62. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  63. cd "${rootdir}"
  64. if [ ! -d "functions" ]; then
  65. mkdir functions
  66. fi
  67. cd functions
  68. echo -e "loading ${functionfile}...\c"
  69. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  70. chmod +x "${functionfile}"
  71. cd "${rootdir}"
  72. sleep 1
  73. fi
  74. source "${rootdir}/functions/${functionfile}"
  75. }
  76. fn_functions(){
  77. # Functions are defined in fn_functions.
  78. functionfile="${FUNCNAME}"
  79. fn_runfunction
  80. }
  81. fn_functions
  82. getopt=$1
  83. fn_getopt