arkserver 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # ARK: Survivial Evolved
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://gameservermanagers.com
  6. version="040715"
  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. backupdir="${rootdir}/backups"
  47. # Logging
  48. logdays="7"
  49. gamelogdir="${systemdir}/logs"
  50. scriptlogdir="${rootdir}/log/script"
  51. consolelogdir="${rootdir}/log/console"
  52. scriptlog="${scriptlogdir}/${servicename}-script.log"
  53. consolelog="${consolelogdir}/${servicename}-console.log"
  54. emaillog="${scriptlogdir}/${servicename}-email.log"
  55. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  56. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  57. ##### Script #####
  58. # Do not edit
  59. fn_runfunction(){
  60. # Functions are downloaded and run with this function
  61. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  62. cd "${rootdir}"
  63. if [ ! -d "functions" ]; then
  64. mkdir functions
  65. fi
  66. cd functions
  67. echo -e " loading ${functionfile}...\c"
  68. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  69. chmod +x "${functionfile}"
  70. cd "${rootdir}"
  71. fi
  72. source "${rootdir}/functions/${functionfile}"
  73. }
  74. fn_functions(){
  75. # Functions are defined in fn_functions.
  76. functionfile="${FUNCNAME}"
  77. fn_runfunction
  78. }
  79. fn_functions
  80. getopt=$1
  81. fn_getopt