| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #!/bin/bash
- # 7 Days To Die
- # Server Management Script
- # Author: Daniel Gibbs
- # Website: http://gameservermanagers.com
- version="040715"
- #### Variables ####
- # Notification Email
- # (on|off)
- emailnotification="off"
- email="email@example.com"
- # Steam login
- steamuser="username"
- steampass="password"
- # Start Variables
- ip="0.0.0.0"
- updateonstart="no"
- # http://7daystodie.gamepedia.com/Server
- fn_parms(){
- parms="-configfile=${servercfgfullpath} -dedicated"
- }
- #### Advanced Variables ####
- # Steam
- appid="294420"
- # Server Details
- servicename="sdtd-server"
- gamename="7 Days To Die"
- engine="unity3d"
- # Directories
- rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- selfname="$(basename $0)"
- lockselfname=".${servicename}.lock"
- filesdir="${rootdir}/serverfiles"
- systemdir="${filesdir}"
- executabledir="${filesdir}"
- executable="./startserver.sh"
- servercfg="${servicename}.xml"
- servercfgdir="${filesdir}"
- servercfgfullpath="${servercfgdir}/${servercfg}"
- servercfgdefault="${servercfgdir}/serverconfig.xml"
- backupdir="${rootdir}/backups"
- # Logging
- logdays="7"
- gamelogdir="${rootdir}/log/server"
- scriptlogdir="${rootdir}/log/script"
- consolelogdir="${rootdir}/log/console"
- gamelog="${gamelogdir}/${servicename}-game.log"
- scriptlog="${scriptlogdir}/${servicename}-script.log"
- consolelog="${consolelogdir}/${servicename}-console.log"
- emaillog="${scriptlogdir}/${servicename}-email.log"
- scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
- consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
- ##### Script #####
- # Do not edit
- fn_runfunction(){
- # Functions are downloaded and run with this function
- if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
- cd "${rootdir}"
- if [ ! -d "functions" ]; then
- mkdir functions
- fi
- cd functions
- echo -e "loading ${functionfile}...\c"
- wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
- chmod +x "${functionfile}"
- cd "${rootdir}"
- sleep 1
- fi
- source "${rootdir}/functions/${functionfile}"
- }
- fn_functions(){
- # Functions are defined in fn_functions.
- functionfile="${FUNCNAME}"
- fn_runfunction
- }
- fn_functions
- getopt=$1
- fn_getopt
|