| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #!/bin/bash
- # Just Cause 2
- # Server Management Script
- # Author: Daniel Gibbs
- # Website: http://gameservermanagers.com
- # Version: 090515
- #### Variables ####
- # Notification Email
- # (on|off)
- emailnotification="off"
- email="email@example.com"
- # Steam login
- steamuser="anonymous"
- steampass=""
- # Start Variables
- maxplayers="10"
- port="7777"
- ip="0.0.0.0"
- updateonstart="no"
- fn_parms(){
- parms="--maxplayers ${maxplayers} --bindip ${ip} --bindport ${port}"
- }
- #### Advanced Variables ####
- # Steam
- appid="261140"
- # Server Details
- servicename="jc2-server"
- gamename="Just Cause 2"
- engine="avalanche"
- # Directories
- rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- selfname="$(basename $0)"
- lockselfname=".${servicename}.lock"
- filesdir="${rootdir}/serverfiles"
- systemdir="${filesdir}"
- executabledir="${filesdir}"
- executable="./Jcmp-Server"
- servercfgdir="${filesdir}"
- servercfg="config.lua"
- servercfgfullpath="${servercfgdir}/${servercfg}"
- backupdir="${rootdir}/backups"
- # Logging
- logdays="7"
- #gamelogdir="" # No server logs available
- scriptlogdir="${rootdir}/log/script"
- consolelogdir="${rootdir}/log/console"
- 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
|