arkserver 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/bash
  2. # ARK: Survivial Evolved
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://gameservermanagers.com
  6. version="090815"
  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. ip="0.0.0.0"
  17. updateonstart="off"
  18. fn_parms(){
  19. parms="TheIsland?listen"
  20. }
  21. #### Advanced Variables ####
  22. # Steam
  23. appid="376030"
  24. # Server Details
  25. servicename="ark-server"
  26. gamename="ARK: Survivial Evolved"
  27. engine="unreal4"
  28. # Directories
  29. rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  30. selfname="$(basename $0)"
  31. lockselfname=".${servicename}.lock"
  32. filesdir="${rootdir}/serverfiles"
  33. systemdir="${filesdir}/ShooterGame"
  34. executabledir="${systemdir}/Binaries/Linux"
  35. executable="./ShooterGameServer"
  36. servercfgdir="${systemdir}/Saved/Config/LinuxServer"
  37. servercfg="GameUserSettings.ini"
  38. servercfgfullpath="${servercfgdir}/${servercfg}"
  39. backupdir="${rootdir}/backups"
  40. # Logging
  41. logdays="7"
  42. gamelogdir="${systemdir}/logs"
  43. scriptlogdir="${rootdir}/log/script"
  44. consolelogdir="${rootdir}/log/console"
  45. scriptlog="${scriptlogdir}/${servicename}-script.log"
  46. consolelog="${consolelogdir}/${servicename}-console.log"
  47. emaillog="${scriptlogdir}/${servicename}-email.log"
  48. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  49. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  50. ##### Script #####
  51. # Do not edit
  52. fn_runfunction(){
  53. # Functions are downloaded and run with this function
  54. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  55. cd "${rootdir}"
  56. if [ ! -d "functions" ]; then
  57. mkdir functions
  58. fi
  59. cd functions
  60. echo -e " loading ${functionfile}...\c"
  61. wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  62. chmod +x "${functionfile}"
  63. cd "${rootdir}"
  64. fi
  65. source "${rootdir}/functions/${functionfile}"
  66. }
  67. fn_functions(){
  68. # Functions are defined in fn_functions.
  69. functionfile="${FUNCNAME}"
  70. fn_runfunction
  71. }
  72. fn_functions
  73. getopt=$1
  74. fn_getopt