ss3sserver 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. # Serious Sam 3: BFE
  3. # Server Management Script
  4. # Author: Daniel Gibbs
  5. # Website: http://danielgibbs.co.uk
  6. # Version: 210115
  7. #### Variables ####
  8. # Notification Email
  9. # (on|off)
  10. emailnotification="off"
  11. email="email@example.com"
  12. # Steam login
  13. steamuser="username"
  14. steampass="password"
  15. # Start Variables
  16. ip="0.0.0.0"
  17. # https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt
  18. fn_parms(){
  19. parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}"
  20. }
  21. #### Advanced Variables ####
  22. # Steam
  23. appid="41080"
  24. # Server Details
  25. servicename="ss3-server"
  26. gamename="Serious Sam 3: BFE"
  27. engine="seriousengine35"
  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}/Bin"
  34. executabledir="${systemdir}"
  35. executable="./runSam3_DedicatedServer.sh"
  36. servercfgdir="${filesdir}/Content/SeriousSam3/Config"
  37. servercfg="${servicename}.ini"
  38. servercfgfullpath="${servercfgdir}/${servercfg}"
  39. backupdir="${rootdir}/backups"
  40. # Logging
  41. logdays="7"
  42. gamelogdir="${rootdir}/log/server"
  43. scriptlogdir="${rootdir}/log/script"
  44. consolelogdir="${rootdir}/log/console"
  45. gamelog="${gamelogdir}/${servicename}-game.log"
  46. scriptlog="${scriptlogdir}/${servicename}-script.log"
  47. consolelog="${consolelogdir}/${servicename}-console.log"
  48. emaillog="${scriptlogdir}/${servicename}-email.log"
  49. gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%d-%m-%Y-%H-%M-%S').log"
  50. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  51. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  52. ##### Script #####
  53. # Do not edit
  54. fn_runfunction(){
  55. # Functions are downloaded and run with this function
  56. if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
  57. cd "${rootdir}"
  58. if [ ! -d "functions" ]; then
  59. mkdir functions
  60. fi
  61. cd functions
  62. echo -e "loading ${functionfile}...\c"
  63. wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
  64. chmod +x "${functionfile}"
  65. cd "${rootdir}"
  66. sleep 1
  67. fi
  68. source "${rootdir}/functions/${functionfile}"
  69. }
  70. fn_functions(){
  71. # Functions are defined in fn_functions.
  72. functionfile="${FUNCNAME}"
  73. fn_runfunction
  74. }
  75. fn_functions
  76. getopt=$1
  77. fn_getopt