|
@@ -1,54 +1,75 @@
|
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
|
-# TravisCI Tests: Teamspeak 3
|
|
|
|
|
-# Server Management Script
|
|
|
|
|
|
|
+# Project: Game Server Managers - LinuxGSM
|
|
|
# Author: Daniel Gibbs
|
|
# Author: Daniel Gibbs
|
|
|
|
|
+# License: MIT License, Copyright (c) 2017 Daniel Gibbs
|
|
|
|
|
+# Purpose: TravisCI Tests: Teamspeak 3 | Server Management Script
|
|
|
|
|
+# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors
|
|
|
|
|
+# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki
|
|
|
# Website: https://gameservermanagers.com
|
|
# Website: https://gameservermanagers.com
|
|
|
-version="101716"
|
|
|
|
|
|
|
|
|
|
|
|
+# Debugging
|
|
|
if [ -f ".dev-debug" ]; then
|
|
if [ -f ".dev-debug" ]; then
|
|
|
exec 5>dev-debug.log
|
|
exec 5>dev-debug.log
|
|
|
BASH_XTRACEFD="5"
|
|
BASH_XTRACEFD="5"
|
|
|
set -x
|
|
set -x
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-#### Variables ####
|
|
|
|
|
|
|
+version="170128"
|
|
|
|
|
|
|
|
-# Notification Alerts
|
|
|
|
|
-# (on|off)
|
|
|
|
|
|
|
+##########################
|
|
|
|
|
+######## Settings ########
|
|
|
|
|
+##########################
|
|
|
|
|
+
|
|
|
|
|
+## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
|
|
|
|
|
+# Edit serverfiles/ts3-server.ini after installation
|
|
|
|
|
|
|
|
-# Email
|
|
|
|
|
|
|
+#### LinuxGSM Settings ####
|
|
|
|
|
+
|
|
|
|
|
+## Notification Alerts
|
|
|
|
|
+# (on|off)
|
|
|
|
|
+# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
|
|
|
emailalert="off"
|
|
emailalert="off"
|
|
|
email="email@example.com"
|
|
email="email@example.com"
|
|
|
-#emailfrom="email@example.com"
|
|
|
|
|
|
|
+emailfrom=""
|
|
|
|
|
|
|
|
-# Pushbullet
|
|
|
|
|
-# https://www.pushbullet.com/#settings
|
|
|
|
|
|
|
+# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
|
|
|
pushbulletalert="off"
|
|
pushbulletalert="off"
|
|
|
pushbullettoken="accesstoken"
|
|
pushbullettoken="accesstoken"
|
|
|
|
|
+channeltag=""
|
|
|
|
|
|
|
|
-# Start Variables
|
|
|
|
|
|
|
+## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update
|
|
|
updateonstart="off"
|
|
updateonstart="off"
|
|
|
|
|
|
|
|
|
|
+## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
|
|
|
|
|
+maxbackups="4"
|
|
|
|
|
+maxbackupdays="30"
|
|
|
|
|
+stoponbackup="on"
|
|
|
|
|
|
|
|
-fn_parms(){
|
|
|
|
|
-parms=""
|
|
|
|
|
-}
|
|
|
|
|
|
|
+## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
|
|
|
|
|
+consolelogging="on"
|
|
|
|
|
+logdays="7"
|
|
|
|
|
|
|
|
-#### Advanced Variables ####
|
|
|
|
|
|
|
+#### LinuxGSM Advanced Settings ####
|
|
|
|
|
|
|
|
-# Github Branch Select
|
|
|
|
|
|
|
+## Github Branch Select
|
|
|
# Allows for the use of different function files
|
|
# Allows for the use of different function files
|
|
|
# from a different repo and/or branch.
|
|
# from a different repo and/or branch.
|
|
|
githubuser="GameServerManagers"
|
|
githubuser="GameServerManagers"
|
|
|
githubrepo="LinuxGSM"
|
|
githubrepo="LinuxGSM"
|
|
|
githubbranch="$TRAVIS_BRANCH"
|
|
githubbranch="$TRAVIS_BRANCH"
|
|
|
|
|
|
|
|
-# Server Details
|
|
|
|
|
-gamename="Teamspeak 3"
|
|
|
|
|
-servername="Teamspeak 3 Server"
|
|
|
|
|
|
|
+## LinuxGSM Server Details
|
|
|
|
|
+# Do not edit
|
|
|
|
|
+gamename="TeamSpeak 3"
|
|
|
|
|
+servername="TeamSpeak 3 Server"
|
|
|
|
|
+
|
|
|
|
|
+## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers
|
|
|
servicename="ts3-server"
|
|
servicename="ts3-server"
|
|
|
|
|
|
|
|
-# Directories
|
|
|
|
|
|
|
+#### Directories ####
|
|
|
|
|
+# Edit with care
|
|
|
|
|
+
|
|
|
|
|
+## Work Directories
|
|
|
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
|
|
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
|
|
|
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
|
|
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
|
|
|
lockselfname=".${servicename}.lock"
|
|
lockselfname=".${servicename}.lock"
|
|
@@ -57,6 +78,8 @@ functionsdir="${lgsmdir}/functions"
|
|
|
libdir="${lgsmdir}/lib"
|
|
libdir="${lgsmdir}/lib"
|
|
|
tmpdir="${lgsmdir}/tmp"
|
|
tmpdir="${lgsmdir}/tmp"
|
|
|
filesdir="${rootdir}/serverfiles"
|
|
filesdir="${rootdir}/serverfiles"
|
|
|
|
|
+
|
|
|
|
|
+## Server Specific Directories
|
|
|
systemdir="${filesdir}"
|
|
systemdir="${filesdir}"
|
|
|
executabledir="${filesdir}"
|
|
executabledir="${filesdir}"
|
|
|
executable="./ts3server_startscript.sh"
|
|
executable="./ts3server_startscript.sh"
|
|
@@ -64,20 +87,23 @@ servercfg="${servicename}.ini"
|
|
|
servercfgdefault="ts3server.ini"
|
|
servercfgdefault="ts3server.ini"
|
|
|
servercfgdir="${filesdir}"
|
|
servercfgdir="${filesdir}"
|
|
|
servercfgfullpath="${servercfgdir}/${servercfg}"
|
|
servercfgfullpath="${servercfgdir}/${servercfg}"
|
|
|
|
|
+
|
|
|
|
|
+## Backup Directory
|
|
|
backupdir="${rootdir}/backups"
|
|
backupdir="${rootdir}/backups"
|
|
|
|
|
|
|
|
-# Logging
|
|
|
|
|
-logdays="7"
|
|
|
|
|
|
|
+## Logging Directories
|
|
|
gamelogdir="${filesdir}/logs"
|
|
gamelogdir="${filesdir}/logs"
|
|
|
scriptlogdir="${rootdir}/log/script"
|
|
scriptlogdir="${rootdir}/log/script"
|
|
|
-
|
|
|
|
|
scriptlog="${scriptlogdir}/${servicename}-script.log"
|
|
scriptlog="${scriptlogdir}/${servicename}-script.log"
|
|
|
emaillog="${scriptlogdir}/${servicename}-email.log"
|
|
emaillog="${scriptlogdir}/${servicename}-email.log"
|
|
|
|
|
|
|
|
-scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
|
|
|
|
|
|
|
+## Logs Naming
|
|
|
|
|
+scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
|
|
|
|
|
|
|
|
-##### Script #####
|
|
|
|
|
-# Do not edit
|
|
|
|
|
|
|
+########################
|
|
|
|
|
+######## Script ########
|
|
|
|
|
+###### Do not edit #####
|
|
|
|
|
+########################
|
|
|
|
|
|
|
|
# Fetches core_dl for file downloads
|
|
# Fetches core_dl for file downloads
|
|
|
fn_fetch_core_dl(){
|
|
fn_fetch_core_dl(){
|