diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver index bce6242dc..f162505c0 100644 --- a/7DaysToDie/sdtdserver +++ b/7DaysToDie/sdtdserver @@ -61,6 +61,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index 263c61a37..e21ac212e 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -37,10 +37,10 @@ rconport="32330" rconpassword="" # Set to enable rcon maxplayers="50" ip="0.0.0.0" -updateonstart="off" - +updateonstart="off" + fn_parms(){ - parms="TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}" +parms="\"TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}\"" } #### Advanced Variables #### @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/ShooterGame" executabledir="${systemdir}/Binaries/Linux" diff --git a/Arma3/arma3server b/Arma3/arma3server index ae9c53ac0..9f4c64e03 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -80,6 +80,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver index 433f4a648..7aceb5515 100644 --- a/BlackMesa/bmdmserver +++ b/BlackMesa/bmdmserver @@ -71,6 +71,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/bms" executabledir="${filesdir}" diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index 37972923f..8289b0544 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/berimbau" executabledir="${filesdir}" diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server index bbf95484e..09c835790 100644 --- a/BrainBread2/bb2server +++ b/BrainBread2/bb2server @@ -71,6 +71,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/brainbread2" executabledir="${filesdir}" diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver index 0699139bc..63f6d5030 100644 --- a/CodenameCURE/ccserver +++ b/CodenameCURE/ccserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cure" executabledir="${filesdir}" diff --git a/CounterStrike/csserver b/CounterStrike/csserver index b03f7bcf2..6e684eba0 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="060816" #### Variables #### @@ -66,12 +66,13 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cstrike" executabledir="${filesdir}" executable="./hlds_run" servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" +servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" servercfgdefault="${servercfgdir}/lgsm-default.cfg" backupdir="${rootdir}/backups" diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index 31a875448..53fb4d9ac 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/czero" executabledir="${filesdir}" diff --git a/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg b/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg index 15906f925..d518c8e0d 100644 --- a/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg +++ b/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg @@ -14,10 +14,18 @@ sv_logecho 1 sv_logfile 1 sv_log_onefile 0 +// Server Hibernation +sv_hibernate_when_empty 1 +sv_hibernate_ms 5 + +// Server Query +// More info at: https://www.gametracker.com/games/csgo/forum.php?thread=91691 +host_name_store 1 +host_info_show 1 +host_players_show 2 + + exec banned_user.cfg exec banned_ip.cfg writeid writeip - - - diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index 6dd95fcb7..b1b3ceedc 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -78,6 +78,11 @@ githubbranch="master" # Steam appid="740" +# Steam App Branch Select +# Allows to opt into the various Steam app branches. Default branch is "". +# Example: "-beta 1.35.4.4" +branch="" + # Server Details servicename="csgo-server" gamename="Counter Strike: Global Offensive" @@ -89,6 +94,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/csgo" executabledir="${filesdir}" diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index 9daa48892..210c05f57 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -38,9 +38,14 @@ clientport="27005" ip="0.0.0.0" updateonstart="off" +# Required: Game Server Login Token +# GSLT is required for running a public server. +# More info: https://gameservermanagers.com/gslt +gslt="" + # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" } #### Advanced Variables #### @@ -66,6 +71,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cstrike" executabledir="${filesdir}" diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index c547b53f4..43f8fa110 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dod" executabledir="${filesdir}" diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index 68d2e7228..8c90f3893 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dod" executabledir="${filesdir}" diff --git a/DayOfInfamy/doi-server b/DayOfInfamy/doiserver similarity index 99% rename from DayOfInfamy/doi-server rename to DayOfInfamy/doiserver index 1f313d0c7..3dde94acf 100644 --- a/DayOfInfamy/doi-server +++ b/DayOfInfamy/doiserver @@ -68,6 +68,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/doi" executabledir="${filesdir}" diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index 1b347d1bd..e41515dbb 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dmc" executabledir="${filesdir}" diff --git a/DontStarveTogether/lgsm-default.ini b/DontStarveTogether/cfg/lgsm-default.ini similarity index 100% rename from DontStarveTogether/lgsm-default.ini rename to DontStarveTogether/cfg/lgsm-default.ini diff --git a/DontStarveTogether/dependencies/libc.so.6 b/DontStarveTogether/dependencies/libc.so.6 deleted file mode 100644 index c007d9f75..000000000 Binary files a/DontStarveTogether/dependencies/libc.so.6 and /dev/null differ diff --git a/DontStarveTogether/dependencies/libpthread.so.0 b/DontStarveTogether/dependencies/libpthread.so.0 deleted file mode 100644 index a4bfc2282..000000000 Binary files a/DontStarveTogether/dependencies/libpthread.so.0 and /dev/null differ diff --git a/DontStarveTogether/dependencies/librt.so.1 b/DontStarveTogether/dependencies/librt.so.1 deleted file mode 100644 index 4d3d88ad2..000000000 Binary files a/DontStarveTogether/dependencies/librt.so.1 and /dev/null differ diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index e7022e71b..9bca51889 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -64,6 +64,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}/bin" diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver index f489912ca..2ff486791 100644 --- a/DoubleActionBoogaloo/dabserver +++ b/DoubleActionBoogaloo/dabserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dab" executabledir="${filesdir}" diff --git a/DoubleActionBoogaloo/dependencies/libm.so.6 b/DoubleActionBoogaloo/dependencies/libm.so.6 deleted file mode 100644 index 39034023b..000000000 Binary files a/DoubleActionBoogaloo/dependencies/libm.so.6 and /dev/null differ diff --git a/EmpiresMod/emserver b/EmpiresMod/emserver new file mode 100644 index 000000000..40ec7116c --- /dev/null +++ b/EmpiresMod/emserver @@ -0,0 +1,161 @@ +#!/bin/bash +# Empires Mod +# Server Management Script +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="210516" + +#### Variables #### + +# Notification Alerts +# (on|off) + +# Email +emailalert="off" +email="email@example.com" + +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + +# Steam login +steamuser="anonymous" +steampass="" + +# Start Variables +defaultmap="emp_district" +maxplayers="62" +port="27015" +sourcetvport="27020" +clientport="27005" +ip="0.0.0.0" +updateonstart="off" + +# Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://gameservermanagers.com/gslt +gslt="" + +# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server +fn_parms(){ +parms="-game empires -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + +# Steam +appid="460040" + +# Server Details +servicename="em-server" +gamename="Empires Mod" +engine="source" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}/empires" +executabledir="${filesdir}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/server.cfg" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${systemdir}/logs" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" +consolelogging="on" + +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 + +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir -p "${filedir}" + fi + echo -e " fetching ${filename}...\c" + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit 1 + fi + chmod +x "${filedir}/${filename}" +fi +source "${filedir}/${filename}" +} + +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_functions.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_dl.sh +core_functions.sh + +getopt=$1 +core_getopt.sh diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index d9759b866..4a5e9d75f 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/fof" executabledir="${filesdir}" diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index c6ca902e4..bc21fda29 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -29,6 +29,11 @@ pushbullettoken="accesstoken" steamuser="anonymous" steampass="" +# Steam App Branch Select +# Allows to opt into the various Steam app branches. Default branch is "". +# Example: "-beta prerelease " +branch="" + # Workshop Variables # http://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers workshopauth="" @@ -41,8 +46,8 @@ maxplayers="16" port="27015" sourcetvport="27020" clientport="27005" -ip="0.0.0.0" tickrate="66" +ip="0.0.0.0" updateonstart="off" # Custom Start Parameters @@ -56,7 +61,7 @@ gslt="" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate {tickrate} +host_workshop_collection ${workshopcollectionid} -authkey ${workshopauth} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}" +parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickrate} +host_workshop_collection ${workshopcollectionid} -authkey ${workshopauth} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}" } #### Advanced Variables #### @@ -82,6 +87,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/garrysmod" addonsdir="${systemdir}/addons" diff --git a/GoldenEyeSource/gesserver b/GoldenEyeSource/gesserver index f3231e6aa..1d7293cde 100644 --- a/GoldenEyeSource/gesserver +++ b/GoldenEyeSource/gesserver @@ -67,6 +67,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/gesource" executabledir="${filesdir}" diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index 7a42ce2df..3d7bf06fa 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/hl2mp" executabledir="${filesdir}" diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver index c55237f74..477eaba63 100644 --- a/HalfLifeDeathmatch/hldmserver +++ b/HalfLifeDeathmatch/hldmserver @@ -65,6 +65,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/valve" executabledir="${filesdir}" diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver index 06459e25d..ee8060dea 100644 --- a/HalfLifeDeathmatchSource/hldmsserver +++ b/HalfLifeDeathmatchSource/hldmsserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/hl1mp" executabledir="${filesdir}" diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index a0f81c036..6929b5324 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -31,8 +31,9 @@ steamuser="anonymous" steampass="" # Server settings -servername="Hurtworld LGSM Server" ip="0.0.0.0" +updateonstart="off" +servername="Hurtworld LGSM Server" port="12871" queryport="12881" maxplayers="20" @@ -79,6 +80,7 @@ selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/Insurgency/dependencies/libc.so.6 b/Insurgency/dependencies/libc.so.6 deleted file mode 100644 index c007d9f75..000000000 Binary files a/Insurgency/dependencies/libc.so.6 and /dev/null differ diff --git a/Insurgency/dependencies/libm.so.6 b/Insurgency/dependencies/libm.so.6 deleted file mode 100644 index 39034023b..000000000 Binary files a/Insurgency/dependencies/libm.so.6 and /dev/null differ diff --git a/Insurgency/dependencies/librt.so.1 b/Insurgency/dependencies/librt.so.1 deleted file mode 100644 index 4d3d88ad2..000000000 Binary files a/Insurgency/dependencies/librt.so.1 and /dev/null differ diff --git a/Insurgency/insserver b/Insurgency/insserver index 58e9b0a0c..1acace084 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -68,6 +68,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/insurgency" executabledir="${filesdir}" diff --git a/JustCause2/jc2server b/JustCause2/jc2server index 63e15f5c5..76ab6dfe8 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -30,6 +30,7 @@ steamuser="anonymous" steampass="" # Start Variables +ip="0.0.0.0" updateonstart="off" fn_parms(){ diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index 24a8c1fb1..15a5ff522 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -65,6 +65,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/System" executabledir="${systemdir}" diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index 165cf7176..d7507a042 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/left4dead" executabledir="${filesdir}" diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index d7801dc2e..f92f589e9 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -25,9 +25,6 @@ email="email@example.com" pushbulletalert="off" pushbullettoken="accesstoken" -# Pushover -#Push alot - # Steam login steamuser="anonymous" steampass="" @@ -68,6 +65,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/left4dead2" executabledir="${filesdir}" diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index 5f30b6fa8..54d0b4e71 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -2,6 +2,7 @@ # Mumble # Server Management Script # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log @@ -9,7 +10,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="290716" #### Variables #### @@ -25,6 +26,23 @@ email="email@example.com" pushbulletalert="off" pushbullettoken="accesstoken" +# Start Variables +updateonstart="off" + +fn_parms(){ +parms="-fg -ini ${servercfgfullpath}" +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + + # Server Details gamename="Mumble" servicename="mumble-server" @@ -35,6 +53,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" @@ -46,7 +65,7 @@ backupdir="${rootdir}/backups" # Logging logdays="7" -logdir="${rootdir}/log" +gamelogdir="${rootdir}/log" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" consolelogging="on" @@ -58,17 +77,6 @@ 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" -fn_parms(){ -parms="-fg -ini ${servercfgfullpath}" -} - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - ##### Script ##### # Do not edit diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver index f23677000..034848163 100644 --- a/NS2Combat/ns2cserver +++ b/NS2Combat/ns2cserver @@ -73,6 +73,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}/ia32" diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index 70f4e7fd5..1190f4a12 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -62,6 +62,11 @@ githubbranch="master" # Steam appid="4940" +# Steam App Branch Select +# Allows to opt into the various Steam app branches. Default branch is "". +# Example: "-beta beta" +branch="" + # Server Details servicename="ns2-server" gamename="Natural Selection 2" @@ -73,6 +78,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index 079726c28..baca45cd3 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -71,6 +71,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/nmrih" executabledir="${filesdir}" diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index c329398fa..394c1a6a7 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/gearbox" executabledir="${filesdir}" diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver index aa8e59f97..4091735b3 100644 --- a/PiratesVikingandKnightsII/pvkiiserver +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/pvkii" executabledir="${filesdir}" diff --git a/ProjectZomboid/cfg/lgsm-default.ini b/ProjectZomboid/cfg/lgsm-default.ini index df25258ab..5ca4fe917 100644 --- a/ProjectZomboid/cfg/lgsm-default.ini +++ b/ProjectZomboid/cfg/lgsm-default.ini @@ -14,10 +14,8 @@ SafetyToggleTimer=100 SafetyCooldownTimer=120 SpawnItems= DefaultPort=16261 -ResetID=834499345 Mods= Map=Muldraugh, KY -SpawnRegions=servertest_spawnregions.lua DoLuaChecksum=true Public=false PublicName=pzserver @@ -33,7 +31,7 @@ NoFireSpread=false NoFire=false AnnounceDeath=false MinutesPerPage=1.0 -HoursForCorpseRemoval=0 +HoursForCorpseRemoval=0.0 SaveWorldEveryMinutes=0 PlayerSafehouse=false AdminSafehouse=false @@ -44,3 +42,25 @@ SafehouseAllowRespawn=false SafehouseDaySurvivedToClaim=0 SafeHouseRemovalTime=144 AllowDestructionBySledgehammer=true +KickFastPlayers=false +RCONPort=27015 +RCONPassword= +Password= +MaxAccountsPerUser=0 +SleepAllowed=false +SleepNeeded=false +SteamPort1=8766 +SteamPort2=8767 +WorkshopItems= +SteamScoreboard=true +SteamVAC=true +UPnP=true +UPnPLeaseTime=86400 +UPnPZeroLeaseTimeFallback=true +UPnPForce=true +CoopServerLaunchTimeout=20 +CoopMasterPingTimeout=60 +server_browser_announced_ip= +UseTCPForMapDownloads=false +PlayerRespawnWithSelf=false +PlayerRespawnWithOther=false \ No newline at end of file diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 98d855ac6..dafab0d38 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -10,7 +10,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="290716" #### Variables #### @@ -31,11 +31,12 @@ steamuser="anonymous" steampass="" # Start Variables +adminpassword="CHANGE_ME" ip="0.0.0.0" updateonstart="off" fn_parms(){ -parms="" +parms="-ip ${ip} -adminpassword \"${adminpassword}\"" } #### Advanced Variables #### @@ -64,6 +65,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/QuakeLive/qlserver b/QuakeLive/qlserver index 35d7be4f7..1e2ece42c 100755 --- a/QuakeLive/qlserver +++ b/QuakeLive/qlserver @@ -69,6 +69,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index 346aeea0e..8f3f0445f 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -61,6 +61,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/system" executabledir="${systemdir}" diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver index 677aadead..ce9179a6a 100644 --- a/Ricochet/ricochetserver +++ b/Ricochet/ricochetserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/ricochet" executabledir="${filesdir}" diff --git a/Rust/rustserver b/Rust/rustserver index 12cc7ca6d..a3eb75c43 100644 --- a/Rust/rustserver +++ b/Rust/rustserver @@ -83,6 +83,7 @@ selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver index 1fe9cdb80..29318d565 100644 --- a/SeriousSam3BFE/ss3sserver +++ b/SeriousSam3BFE/ss3sserver @@ -61,6 +61,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/Bin" executable="./runSam3_DedicatedServer.sh" diff --git a/Starbound/sbserver b/Starbound/sbserver index ae779c627..762915c3d 100644 --- a/Starbound/sbserver +++ b/Starbound/sbserver @@ -60,6 +60,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}/linux" diff --git a/SvenCoop/svencoopserver b/SvenCoop/svencoopserver index 94dc65f63..9687c1452 100644 --- a/SvenCoop/svencoopserver +++ b/SvenCoop/svencoopserver @@ -65,6 +65,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/svencoop" executabledir="${filesdir}" diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index 73d824e9d..ca8c2e150 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -71,6 +71,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/tf" executabledir="${filesdir}" diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index 2054c5aea..476e6c68a 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -66,6 +66,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/tfc" executabledir="${filesdir}" diff --git a/TeamSpeak3/cfg/lgsm-default.ini b/TeamSpeak3/cfg/lgsm-default.ini index 71000a42e..0fca88d4d 100644 --- a/TeamSpeak3/cfg/lgsm-default.ini +++ b/TeamSpeak3/cfg/lgsm-default.ini @@ -1,11 +1,11 @@ machine_id= default_voice_port=9987 -voice_ip=0.0.0.0 +voice_ip=0.0.0.0, :: licensepath= filetransfer_port=30033 -filetransfer_ip=0.0.0.0 +filetransfer_ip=0.0.0.0, :: query_port=10011 -query_ip=0.0.0.0 +query_ip=0.0.0.0, :: query_ip_whitelist=query_ip_whitelist.txt query_ip_blacklist=query_ip_blacklist.txt dbplugin=ts3db_sqlite3 @@ -17,4 +17,4 @@ logpath=logs logquerycommands=0 dbclientkeepdays=30 logappend=0 -query_skipbruteforcecheck=0 \ No newline at end of file +query_skipbruteforcecheck=0 diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index 7a6491bff..c297e8876 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -1,5 +1,5 @@ #!/bin/bash -# Teamspeak 3 +# TeamSpeak 3 # Server Management Script # Author: Daniel Gibbs # Website: https://gameservermanagers.com @@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="290716" #### Variables #### @@ -29,8 +29,8 @@ pushbullettoken="accesstoken" updateonstart="off" # Server Details -gamename="Teamspeak 3" -servername="Teamspeak 3 Server" +gamename="TeamSpeak 3" +servername="TeamSpeak 3 Server" servicename="ts3-server" # Directories @@ -39,6 +39,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/Teeworlds/cfg/tdm.cfg b/Teeworlds/cfg/tdm.cfg index c2ab04326..4cde3cd33 100644 --- a/Teeworlds/cfg/tdm.cfg +++ b/Teeworlds/cfg/tdm.cfg @@ -1,6 +1,6 @@ // **************************************************************************** // * -// TeeWorlds - tdm.cfg * +// Teeworlds - tdm.cfg * // Version 281015 * // * // **************************************************************************** diff --git a/Teeworlds/twserver b/Teeworlds/twserver index 7bcf15714..6b29f0e81 100644 --- a/Teeworlds/twserver +++ b/Teeworlds/twserver @@ -61,6 +61,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver index e86cfdca0..f51fb642a 100644 --- a/Terraria/terrariaserver +++ b/Terraria/terrariaserver @@ -61,6 +61,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index 5fe046c2e..9515059d3 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -44,6 +44,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/System" executabledir="${systemdir}" diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index 707f4dc2e..b8208117d 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -20,7 +20,7 @@ version="210516" emailalert="off" email="email@example.com" -# Pushbullet +# Pushbullet # https://www.pushbullet.com/#settings pushbulletalert="off" pushbullettoken="accesstoken" @@ -53,6 +53,7 @@ selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/System" executabledir="${systemdir}" @@ -112,7 +113,7 @@ if [ ! -f "${filedir}/${filename}" ]; then exit 1 else echo -e "\e[0;32mOK\e[0m" - fi + fi else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" diff --git a/images/logo/lgsm-250x130-dark.png b/images/logo/lgsm-250x130-dark.png new file mode 100644 index 000000000..2490a4fde Binary files /dev/null and b/images/logo/lgsm-250x130-dark.png differ diff --git a/images/logo/lgsm-250x143-dark.png b/images/logo/lgsm-250x143-dark.png deleted file mode 100644 index 6d87e0e2b..000000000 Binary files a/images/logo/lgsm-250x143-dark.png and /dev/null differ diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 206abba22..9cef86e95 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -28,7 +28,7 @@ fn_alert_restart_query(){ fn_alert_update(){ fn_script_log_info "Sending update alert" alertsubject="LGSM - Updated - ${servername}" - alertbody="${servicename} recieved update" + alertbody="${servicename} received update" } if [ "${alert}" == "restart" ]; then @@ -41,9 +41,9 @@ elif [ "${alert}" == "test" ]; then fn_alert_test fi -if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then +if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then alert_email.sh -elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then +elif [ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_warn_nl "Email alerts not enabled" fn_script_log_warn "Email alerts not enabled" elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index e0d84b255..52529db6f 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -2,7 +2,7 @@ # LGSM alert_email.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Sends email alert if monitor picks up a failure. +# Description: Sends email alert including server details and logs. local commandname="ALERT" local commandaction="Alert" @@ -32,7 +32,7 @@ fn_details_os(){ echo -e "" echo -e "Distro Details" echo -e "=================================" - echo -e "Distro: ${os}" + echo -e "Distro: ${distroname}" echo -e "Arch: ${arch}" echo -e "Kernel: ${kernel}" echo -e "Hostname: $HOSTNAME" @@ -153,7 +153,7 @@ fn_details_gameserver(){ echo -e "Tick rate: ${tickrate}" fi - # Teamspeak dbplugin + # TeamSpeak dbplugin if [ -n "${dbplugin}" ]; then echo -e "dbplugin: ${dbplugin}" fi diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index e8e65c607..221701a7d 100644 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -2,7 +2,7 @@ # LGSM alert_pushbullet.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: alerts using pushbullet. +# Description: Sends Pushbullet alert including the server status. local commandname="ALERT" local commandaction="Alert" diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index ac5fb9bc8..58a3041d7 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -2,7 +2,6 @@ # LGSM check.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com - # Description: Overall function for managing checks. # Runs checks that will either halt on or fix an issue. @@ -14,7 +13,7 @@ local commandname="CHECK" check_root.sh check_permissions.sh -if [ "${function_selfname}" != "command_install.sh" ] && [ "${function_selfname}" != "command_update_functions.sh" ]; then +if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]; then check_system_dir.sh fi @@ -60,14 +59,6 @@ do fi done -local allowed_commands_array=( command_console.sh command_start.sh ) -for allowed_command in "${allowed_commands_array[@]}" -do - if [ "${allowed_command}" == "${function_selfname}" ]||[ "${gamename}" != "Teamspeak 3" ]; then - check_tmux.sh - fi -done - local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh ) for allowed_command in "${allowed_commands_array[@]}" do @@ -84,7 +75,7 @@ do fi done -local allowed_commands_array=( command_install.sh command_start.sh command_debug.sh ) +local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh ) for allowed_command in "${allowed_commands_array[@]}" do if [ "${allowed_command}" == "${function_selfname}" ]; then diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index 61d0a8caf..9ad4c7baa 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -2,7 +2,7 @@ # LGSM check_config.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: If server config missing warn user. +# Description: Checks if the server config is missing and warns the user if needed. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index beec79829..57f432ec4 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -2,14 +2,14 @@ # LGSM check_deps.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks that the requires dependencies are installed for LGSM. +# Description: Checks if required dependencies are installed for LGSM. local commandname="CHECK" fn_deps_detector(){ # Checks if dependency is missing if [ -n "$(command -v dpkg-query)" ]; then - dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null| grep -q -P '^install ok installed$' + dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null | grep -q -P '^install ok installed$' depstatus=$? elif [ -n "$(command -v yum)" ]; then yum -q list installed ${deptocheck} > /dev/null 2>&1 @@ -18,6 +18,11 @@ fn_deps_detector(){ if [ "${depstatus}" == "0" ]; then missingdep=0 if [ "${function_selfname}" == "command_install.sh" ]; then + if [ "${tmuxcheck}" == "1" ]; then + # Added for users compiling tmux from source to bypass rpm check + echo -e "${green}tmux${default}" + unset tmuxcheck + fi echo -e "${green}${deptocheck}${default}" sleep 0.5 fi @@ -63,7 +68,7 @@ fn_found_missing_deps(){ if [ "${#array_deps_missing[@]}" != "0" ]; then fn_print_dots "Checking dependencies" sleep 0.5 - fn_print_error "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}" + fn_print_error_nl "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}" fn_script_log_error "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}" sleep 1 sudo -v > /dev/null 2>&1 @@ -86,7 +91,7 @@ fn_found_missing_deps(){ fi if [ $? != 0 ]; then fn_print_failure_nl "Unable to install dependencies" - fn_script_log_fail "Unable to install dependencies" + fn_script_log_fatal "Unable to install dependencies" else fn_print_complete_nl "Install dependencies completed" fn_script_log_pass "Install dependencies completed" @@ -133,15 +138,19 @@ if [ -n "$(command -v dpkg-query)" ]; then array_deps_missing=() # LGSM requirements - array_deps_required=( curl ca-certificates file bsdmainutils util-linux python ) + array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip ) # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then - array_deps_required+=( tmux ) + if [ "$(command -v tmux)" ]||[ "$(which tmux 2>/dev/null)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then + tmuxcheck=1 # Added for users compiling tmux from source to bypass rpm check + else + array_deps_required+=( tmux ) + fi fi # All servers except ts3 & mumble require libstdc++6, lib32gcc1 - if [ "${executable}" != "./ts3server_startscript.sh" ]||[ "${executable}" != "./murmur.x86" ]; then + if [ "${gamename}" != "TeamSpeak 3" ]||[ "${gamename}" != "Mumble" ]; then if [ "${arch}" == "x86_64" ]; then array_deps_required+=( lib32gcc1 libstdc++6:i386 ) else @@ -157,14 +166,19 @@ if [ -n "$(command -v dpkg-query)" ]; then # 7 Days to Die elif [ "${gamename}" == "7 Days To Die" ]; then array_deps_required+=( telnet expect ) - # No More Room in Hell - elif [ "${gamename}" == "No More Room in Hell" ]; then - array_deps_required+=( lib32tinfo5 ) + # No More Room in Hell, Counter Strike: Source and Garry's Mod + elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]; then + if [ "${arch}" == "x86_64" ]; then + array_deps_required+=( lib32tinfo5 ) + else + array_deps_required+=( libtinfo5 ) + fi # Brainbread 2 and Don't Starve Together elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then array_deps_required+=( libcurl4-gnutls-dev:i386 ) + # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then - array_deps_required+=( openjdk-7-jre ) + array_deps_required+=( default-jdk ) # Unreal engine elif [ "${executable}" == "./ucc-bin" ]; then #UT2K4 @@ -183,11 +197,19 @@ elif [ -n "$(command -v yum)" ]; then array_deps_missing=() # LGSM requirements - array_deps_required=( curl util-linux python file ) + if [ "${distroversion}" == "6" ]; then + array_deps_required=( curl wget util-linux-ng python file gzip bzip2 ) + else + array_deps_required=( curl wget util-linux python file gzip bzip2 ) + fi # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then - array_deps_required+=( tmux ) + if [ "$(command -v tmux)" ]||[ "$(which tmux 2>/dev/null)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then + tmuxcheck=1 # Added for users compiling tmux from source to bypass rpm check + else + array_deps_required+=( tmux ) + fi fi # All servers excelts ts3 & mumble require glibc.i686 libstdc++.i686 @@ -203,15 +225,16 @@ elif [ -n "$(command -v yum)" ]; then # 7 Days to Die elif [ "${gamename}" == "7 Days To Die" ]; then array_deps_required+=( telnet expect ) - # No More Room in Hell - elif [ "${gamename}" == "No More Room in Hell" ]; then + # No More Room in Hell, Counter Strike: Source and Garry's Mod + elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]; then array_deps_required+=( ncurses-libs.i686 ) # Brainbread 2 and Don't Starve Together elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then array_deps_required+=( libcurl.i686 ) + # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then - array_deps_required+=( java-1.7.0-openjdk ) - # Unreal engine + array_deps_required+=( java-1.8.0-openjdk ) + # Unreal Engine elif [ "${executable}" == "./ucc-bin" ]; then #UT2K4 if [ -f "${executabledir}/ut2004-bin" ]; then diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh index 8b0fe339c..2fcd6e8a1 100644 --- a/lgsm/functions/check_glibc.sh +++ b/lgsm/functions/check_glibc.sh @@ -2,7 +2,7 @@ # LGSM check_glibc.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks if server has correct glibc or has a fix available. +# Description: Checks if the server has the correct Glibc version or a fix available. local commandname="CHECK" diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index 5375bcac6..8c1c264c2 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -3,12 +3,12 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com # Description: Automatically identifies the server interface IP. -# If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0". +# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0". local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -if [ "${gamename}" != "Teamspeak 3" ]; then +if [ "${gamename}" != "TeamSpeak 3" ]; then if [ ! -f "/bin/ip" ]; then ipcommand="/sbin/ip" else @@ -19,9 +19,11 @@ if [ "${gamename}" != "Teamspeak 3" ]; then if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then if [ "${getipwc}" -ge "2" ]; then - fn_print_dots "" - sleep 0.5 - fn_print_fail "Multiple active network interfaces found.\n\n" + fn_print_dots "Check IP" + sleep 1 + fn_print_fail "Check IP: Multiple active network interfaces found." + sleep 1 + echo -en "\n" fn_print_infomation "Specify the IP you want to use within the ${selfname} script.\n" echo -en "Set ip=\"0.0.0.0\" to one of the following:\n" echo -en "${getip}\n" diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh index 3012203fb..5bd69bb0f 100644 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -2,13 +2,13 @@ # LGSM check_logs.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks that log files exist on server start +# Description: Checks if log files exist. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -# Create dir's for the script and console logs -if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "Teamspeak 3" ]; then +# Create directories for the script and console logs +if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then fn_print_dots "Checking for log files" sleep 0.5 fn_print_info_nl "Checking for log files: Creating log files" diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 2eb312312..c41f8d67f 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -3,27 +3,29 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Checks script, files and folders ownership and permissions. +# Description: Checks ownership & permissions of scripts, files and folders. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_check_ownership(){ - if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||[ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then - fn_print_fail_nl "Permissions issues found" - fn_script_log_fatal "Permissions issues found" - fn_print_infomation_nl "The current user ($(whoami)) does not have ownership of the following files:" - fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" - { - echo -e "User\tGroup\tFile\n" - find "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" - } | column -s $'\t' -t | tee -a "${scriptlog}" - core_exit.sh + if [ -d "${filesdir}" ]; then + if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||[ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then + fn_print_fail_nl "Permissions issues found" + fn_script_log_fatal "Permissions issues found" + fn_print_infomation_nl "The current user ($(whoami)) does not have ownership of the following files:" + fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" + { + echo -e "User\tGroup\tFile\n" + find "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + } | column -s $'\t' -t | tee -a "${scriptlog}" + core_exit.sh + fi fi } fn_check_permissions(){ - if [ -n "${functionsdir}" ]; then + if [ -d "${functionsdir}" ]; then if [ $(find "${functionsdir}" -type f -not -executable|wc -l) -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" @@ -56,4 +58,4 @@ fn_check_permissions(){ } fn_check_ownership -fn_check_permissions \ No newline at end of file +fn_check_permissions diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh index 903075c29..70067f5e5 100644 --- a/lgsm/functions/check_root.sh +++ b/lgsm/functions/check_root.sh @@ -2,6 +2,7 @@ # LGSM check_root.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Checks if the user tried to run the script as root. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index f82d75b58..f68fd9a52 100644 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -1,13 +1,14 @@ #!/bin/bash # LGSM check_status.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Checks the proccess status of the server. Either online or offline. +# Description: Checks the process status of the server. Either online or offline. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then # 1: Server is running # 0: Server seems to have died # 0: No server running (ts3server.pid is missing) @@ -18,6 +19,16 @@ if [ "${gamename}" == "Teamspeak 3" ]; then ts3error="${status}" status=0 fi + +elif [ "${gamename}" == "Mumble" ]; then + # 1: Server is listening + # 0: Server is not listening, considered closed + mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep 64738 | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') + if [ -z "${mumblepid}" ]; then + status=0 + else + status=1 + fi else status=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") fi diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index 44fe50e4f..01da9cda2 100644 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -2,7 +2,7 @@ # LGSM check_steamcmd.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks SteamCMD is installed and correct. +# Description: Checks if SteamCMD is installed correctly. local commandname="CHECK" @@ -15,9 +15,8 @@ fn_install_steamcmd(){ chmod +x "${steamcmddir}/steamcmd.sh" } - fn_check_steamcmd_user(){ - # Checks steamuser is setup. + # Checks if steamuser is setup. if [ "${steamuser}" == "username" ]; then fn_print_fail_nl "Steam login not set. Update steamuser in ${selfname}." echo " * Change steamuser=\"username\" to a valid steam login." @@ -59,7 +58,7 @@ fn_check_steamcmd_sh(){ fn_check_steamcmd_guard(){ if [ "${function_selfname}" == "command_update.sh" ]||[ "${function_selfname}" == "command_validate.sh" ]; then - # Checks that steamcmd is working correctly and will prompt Steam Guard if required. + # Checks that SteamCMD is working correctly and will prompt Steam Guard if required. "${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit if [ $? -ne 0 ]; then fn_print_failure_nl "Error running SteamCMD" @@ -69,5 +68,5 @@ fn_check_steamcmd_guard(){ fn_check_steamcmd_user fn_check_steamcmd_sh -# stdbuf has now replaced unbuffer. This shoudl no longer be required +# stdbuf has now replaced unbuffer. This should not longer be required. #fn_check_steamcmd_guard \ No newline at end of file diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh index 9c6448ca1..d06cbba05 100644 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/functions/check_system_dir.sh @@ -2,6 +2,7 @@ # LGSM check_system_dir.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Checks if systemdir is accessible. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index d9e56cc5f..1d735642d 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -16,13 +16,20 @@ if [ "${gamename}" == "Rust" ]; then ramrequirementgb="4" fi +if [ "${gamename}" == "ARMA 3" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +fi + # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. -if [ -n "${ramrequirement}" ]; then +if [ -n "${ramrequirementmb}" ]; then if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then + fn_print_dots "Check RAM" + sleep 0.5 # Warn the user - fn_print_warn "Insufficient memory: ${ramrequirementgb}G required, ${physmemtotal} available" + fn_print_warn_nl "Check RAM: ${ramrequirementgb}G required, ${physmemtotal} available" sleep 1 - fn_print_warning "You may experiance poor performance from your server" + echo " * ${gamename} server may fail to run or experience poor performance." sleep 1 fi fi diff --git a/lgsm/functions/check_tmux.sh b/lgsm/functions/check_tmux.sh deleted file mode 100644 index 3af90a4b6..000000000 --- a/lgsm/functions/check_tmux.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# LGSM check_tmux.sh function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Checks if tmux is installed as too many users do not RTFM or know how to use Google. - -local commandname="CHECK" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - -if [ "$(command -v tmux)" ]||[ "$(which tmux >/dev/null 2>&1)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then - : -else - fn_print_fail_nl "Tmux not installed" - sleep 1 - fn_script_log_fatal "Tmux is not installed" - echo " * Tmux is required to run this server." - # Suitable passive agressive message - echo " * Please see the the following link." - echo " * https://gameservermanagers.com/tmux-not-found" - core_exit.sh -fi diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 4c9a1b39d..ca6fe9607 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -47,7 +47,7 @@ if [ ! -d "${backupdir}" ]; then mkdir "${backupdir}" fi tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "backups" ./* -if [ $? != 0 ]; then +if [ $? == 0 ]; then fn_print_ok_nl "Backup created: ${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size" fn_script_log_pass "Backup created: ${backupdir}/${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size" else @@ -56,4 +56,4 @@ else fi sleep 1 echo "" -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index a83defc3d..79dc4a4d5 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -2,7 +2,7 @@ # LGSM command_debug.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Runs the server without tmux. Runs direct from the terminal. +# Description: Runs the server without tmux and directly from the terminal. local commandname="DEBUG" local commandaction="Debug" @@ -28,7 +28,7 @@ echo "" echo "${gamename} Debug" echo "=================================" echo "" -echo -e "Distro: ${os}" +echo -e "Distro: ${distroname}" echo -e "Arch: ${arch}" echo -e "Kernel: ${kernel}" echo -e "Hostname: $HOSTNAME" diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 7eb9f9933..cbac77f7a 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_details.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Displays server infomation. @@ -26,7 +27,7 @@ fn_details_os(){ echo -e "${lightyellow}Distro Details${default}" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = { - echo -e "${blue}Distro:\t${default}${os}" + echo -e "${blue}Distro:\t${default}${distroname}" echo -e "${blue}Arch:\t${default}${arch}" echo -e "${blue}Kernel:\t${default}${kernel}" echo -e "${blue}Hostname:\t${default}$HOSTNAME" @@ -43,7 +44,7 @@ fn_details_performance(){ # Avg Load: 1.00, 1.01, 0.78 # # Mem: total used free cached - # Physical: 741M 656M 85M 256M + # Physical: 741M 656M 85M 256M # Swap: 0B 0B 0B echo -e "" @@ -150,7 +151,7 @@ fn_details_gameserver(){ echo -e "${blue}Tick rate:\t${default}${tickrate}" fi - # Teamspeak dbplugin + # TeamSpeak dbplugin if [ -n "${dbplugin}" ]; then echo -e "${blue}dbplugin:\t${default}${dbplugin}" fi @@ -286,7 +287,7 @@ fn_details_ports(){ echo -e "Change ports by editing the parameters in:" parmslocation="${red}UNKNOWN${default}" - local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "Teamspeak 3" "7 Days To Die" ) + local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "TeamSpeak 3" "Mumble" "7 Days To Die" ) for port_edit in "${ports_edit_array[@]}" do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then @@ -441,6 +442,16 @@ fn_details_teamspeak3(){ } | column -s $'\t' -t } +fn_details_mumble(){ + echo -e "netstat -atunp | grep murmur" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Voice\tINBOUND\t${port}\tudp" + echo -e "> ServerQuery\tINBOUND\t${port}\ttcp" + } | column -s $'\t' -t +} + fn_details_teeworlds(){ echo -e "netstat -atunp | grep teeworlds_srv" echo -e "" @@ -569,7 +580,7 @@ fn_details_gameserver fn_details_script fn_details_backup # Some game servers do not have parms. -if [ "${gamename}" != "Teamspeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then +if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then fn_parms fn_details_commandlineparms fi @@ -606,8 +617,10 @@ elif [ "${gamename}" == "Hurtworld" ]; then fn_details_hurtworld elif [ "${gamename}" == "7 Days To Die" ]; then fn_details_sdtd -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then fn_details_teamspeak3 +elif [ "${gamename}" == "Mumble" ]; then + fn_details_mumble elif [ "${gamename}" == "Rust" ]; then fn_details_rust else diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index bfaa86f18..6186c0fb0 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -2,7 +2,7 @@ # LGSM command_dev_debug.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Dev only: enables debuging log to be saved to dev-debug.log. +# Description: Dev only: Enables debugging log to be saved to dev-debug.log. local commandname="DEV-DEBUG" local commandaction="Dev-Debug" diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index c29fdc33a..d5d556c6b 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -42,62 +42,62 @@ else echo "readelf/eu-readelf not installed" fi -${readelf} -d ${executable} |grep NEEDED|awk '{ print $5 }'|sed 's/\[//g'|sed 's/\]//g' > "${rootdir}/.depdetect_readelf" +${readelf} -d ${executable} |grep NEEDED|awk '{ print $5 }'|sed 's/\[//g'|sed 's/\]//g' > "${lgsmdir}/tmp/.depdetect_readelf" -echo "yum install " > "${rootdir}/.depdetect_centos_list_uniq" -echo "apt-get install " > "${rootdir}/.depdetect_ubuntu_list_uniq" -echo "apt-get install " > "${rootdir}/.depdetect_debian_list_uniq" +echo "yum install " > "${lgsmdir}/tmp/.depdetect_centos_list_uniq" +echo "apt-get install " > "${lgsmdir}/tmp/.depdetect_ubuntu_list_uniq" +echo "apt-get install " > "${lgsmdir}/tmp/.depdetect_debian_list_uniq" while read lib; do sharedlib=${lib} if [ "${lib}" == "libm.so.6" ]||[ "${lib}" == "libc.so.6" ]||[ "${lib}" == "libpthread.so.0" ]||[ "${lib}" == "libdl.so.2" ]||[ "${lib}" == "libnsl.so.1" ]||[ "${lib}" == "libgcc_s.so.1" ]||[ "${lib}" == "librt.so.1" ]||[ "${lib}" == "ld-linux.so.2" ]; then - echo "glibc.i686" >> "${rootdir}/.depdetect_centos_list" - echo "lib32gcc1" >> "${rootdir}/.depdetect_ubuntu_list" - echo "lib32gcc1" >> "${rootdir}/.depdetect_debian_list" + echo "glibc.i686" >> "${lgsmdir}/tmp/.depdetect_centos_list" + echo "lib32gcc1" >> "${lgsmdir}/tmp/.depdetect_ubuntu_list" + echo "lib32gcc1" >> "${lgsmdir}/tmp/.depdetect_debian_list" elif [ "${lib}" == "libstdc++.so.6" ]; then - echo "libstdc++.i686" >> "${rootdir}/.depdetect_centos_list" - echo "libstdc++6:i386" >> "${rootdir}/.depdetect_ubuntu_list" - echo "libstdc++6:i386" >> "${rootdir}/.depdetect_debian_list" + echo "libstdc++.i686" >> "${lgsmdir}/tmp/.depdetect_centos_list" + echo "libstdc++6:i386" >> "${lgsmdir}/tmp/.depdetect_ubuntu_list" + echo "libstdc++6:i386" >> "${lgsmdir}/tmp/.depdetect_debian_list" elif [ "${lib}" == "libstdc++.so.5" ]; then - echo "compat-libstdc++-33.i686" >> "${rootdir}/.depdetect_centos_list" - echo "libstdc++5:i386" >> "${rootdir}/.depdetect_ubuntu_list" - echo "libstdc++5:i386" >> "${rootdir}/.depdetect_debian_list" + echo "compat-libstdc++-33.i686" >> "${lgsmdir}/tmp/.depdetect_centos_list" + echo "libstdc++5:i386" >> "${lgsmdir}/tmp/.depdetect_ubuntu_list" + echo "libstdc++5:i386" >> "${lgsmdir}/tmp/.depdetect_debian_list" elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then - echo "speex.i686" >> "${rootdir}/.depdetect_centos_list" - echo "speex:i386" >> "${rootdir}/.depdetect_ubuntu_list" - echo "speex:i386" >> "${rootdir}/.depdetect_debian_list" + echo "speex.i686" >> "${lgsmdir}/tmp/.depdetect_centos_list" + echo "speex:i386" >> "${lgsmdir}/tmp/.depdetect_ubuntu_list" + echo "speex:i386" >> "${lgsmdir}/tmp/.depdetect_debian_list" elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then - echo "SDL.i686" >> "${rootdir}/.depdetect_centos_list" - echo "libsdl1.2debian" >> "${rootdir}/.depdetect_ubuntu_list" - echo "libsdl1.2debian" >> "${rootdir}/.depdetect_debian_list" + echo "SDL.i686" >> "${lgsmdir}/tmp/.depdetect_centos_list" + echo "libsdl1.2debian" >> "${lgsmdir}/tmp/.depdetect_ubuntu_list" + echo "libsdl1.2debian" >> "${lgsmdir}/tmp/.depdetect_debian_list" elif [ "${lib}" == "libtbb.so.2" ]; then - echo "tbb.i686" >> "${rootdir}/.depdetect_centos_list" - echo "libtbb2" >> "${rootdir}/.depdetect_ubuntu_list" - echo "libtbb2" >> "${rootdir}/.depdetect_debian_list" + echo "tbb.i686" >> "${lgsmdir}/tmp/.depdetect_centos_list" + echo "libtbb2" >> "${lgsmdir}/tmp/.depdetect_ubuntu_list" + echo "libtbb2" >> "${lgsmdir}/tmp/.depdetect_debian_list" elif [ "${lib}" == "libtier0.so" ]||[ "${lib}" == "Core.so" ]||[ "${lib}" == "Editor.so" ]||[ "${lib}" == "Engine.so" ]||[ "${lib}" == "liblua.so" ]||[ "${lib}" == "libsteam_api.so" ]||[ "${lib}" == "ld-linux-x86-64.so.2" ]||[ "${lib}" == "libPhysX3_x86.so" ]||[ "${lib}" == "libPhysX3Common_x86.so" ]||[ "${lib}" == "libPhysX3Cooking_x86.so" ]; then # Known shared libs what dont requires dependencies : else unknownlib=1 - echo "${lib}" >> "${rootdir}/.depdetect_unknown" + echo "${lib}" >> "${lgsmdir}/tmp/.depdetect_unknown" fi -done < "${rootdir}/.depdetect_readelf" -sort "${rootdir}/.depdetect_centos_list" | uniq >> "${rootdir}/.depdetect_centos_list_uniq" -sort "${rootdir}/.depdetect_ubuntu_list" | uniq >> "${rootdir}/.depdetect_ubuntu_list_uniq" -sort "${rootdir}/.depdetect_debian_list" | uniq >> "${rootdir}/.depdetect_debian_list_uniq" +done < "${lgsmdir}/tmp/.depdetect_readelf" +sort "${lgsmdir}/tmp/.depdetect_centos_list" | uniq >> "${lgsmdir}/tmp/.depdetect_centos_list_uniq" +sort "${lgsmdir}/tmp/.depdetect_ubuntu_list" | uniq >> "${lgsmdir}/tmp/.depdetect_ubuntu_list_uniq" +sort "${lgsmdir}/tmp/.depdetect_debian_list" | uniq >> "${lgsmdir}/tmp/.depdetect_debian_list_uniq" if [ "${unknownlib}" == "1" ]; then - sort "${rootdir}/.depdetect_unknown" | uniq >> "${rootdir}/.depdetect_unknown_uniq" + sort "${lgsmdir}/tmp/.depdetect_unknown" | uniq >> "${lgsmdir}/tmp/.depdetect_unknown_uniq" fi -awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_centos_list_uniq" > "${rootdir}/.depdetect_centos_line" -awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_ubuntu_list_uniq" > "${rootdir}/.depdetect_ubuntu_line" -awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_debian_list_uniq" > "${rootdir}/.depdetect_debian_line" +awk -vORS=' ' '{ print $1, $2 }' "${lgsmdir}/tmp/.depdetect_centos_list_uniq" > "${lgsmdir}/tmp/.depdetect_centos_line" +awk -vORS=' ' '{ print $1, $2 }' "${lgsmdir}/tmp/.depdetect_ubuntu_list_uniq" > "${lgsmdir}/tmp/.depdetect_ubuntu_line" +awk -vORS=' ' '{ print $1, $2 }' "${lgsmdir}/tmp/.depdetect_debian_list_uniq" > "${lgsmdir}/tmp/.depdetect_debian_line" echo "" echo "Required Dependencies" @@ -106,46 +106,46 @@ echo "${executable}" echo "" echo "CentOS" echo "=================================" -cat "${rootdir}/.depdetect_centos_line" +cat "${lgsmdir}/tmp/.depdetect_centos_line" echo "" echo "" echo "Ubuntu" echo "=================================" -cat "${rootdir}/.depdetect_ubuntu_line" +cat "${lgsmdir}/tmp/.depdetect_ubuntu_line" echo "" echo "" echo "Debian" echo "=================================" -cat "${rootdir}/.depdetect_debian_line" +cat "${lgsmdir}/tmp/.depdetect_debian_line" echo "" if [ "${unknownlib}" == "1" ]; then echo "" echo "Unknown shared Library" echo "=================================" - cat "${rootdir}/.depdetect_unknown" + cat "${lgsmdir}/tmp/.depdetect_unknown" fi echo "" echo "Required Librarys" echo "=================================" -sort "${rootdir}/.depdetect_readelf" |uniq +sort "${lgsmdir}/tmp/.depdetect_readelf" |uniq echo "" echo "ldd" echo "=================================" ldd ${executable} echo -en "\n" -rm -f "${rootdir}/.depdetect_centos_line" -rm -f "${rootdir}/.depdetect_centos_list" -rm -f "${rootdir}/.depdetect_centos_list_uniq" +rm -f "${lgsmdir}/tmp/.depdetect_centos_line" +rm -f "${lgsmdir}/tmp/.depdetect_centos_list" +rm -f "${lgsmdir}/tmp/.depdetect_centos_list_uniq" -rm -f "${rootdir}/.depdetect_debian_line" -rm -f "${rootdir}/.depdetect_debian_list" -rm -f "${rootdir}/.depdetect_debian_list_uniq" +rm -f "${lgsmdir}/tmp/.depdetect_debian_line" +rm -f "${lgsmdir}/tmp/.depdetect_debian_list" +rm -f "${lgsmdir}/tmp/.depdetect_debian_list_uniq" -rm -f "${rootdir}/.depdetect_ubuntu_line" -rm -f "${rootdir}/.depdetect_ubuntu_list" -rm -f "${rootdir}/.depdetect_ubuntu_list_uniq" +rm -f "${lgsmdir}/tmp/.depdetect_ubuntu_line" +rm -f "${lgsmdir}/tmp/.depdetect_ubuntu_list" +rm -f "${lgsmdir}/tmp/.depdetect_ubuntu_list_uniq" -rm -f "${rootdir}/.depdetect_readelf" +rm -f "${lgsmdir}/tmp/.depdetect_readelf" -rm -f "${rootdir}/.depdetect_unknown" -rm -f "${rootdir}/.depdetect_unknown_uniq" \ No newline at end of file +rm -f "${lgsmdir}/tmp/.depdetect_unknown" +rm -f "${lgsmdir}/tmp/.depdetect_unknown_uniq" \ No newline at end of file diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh new file mode 100644 index 000000000..073da2cd7 --- /dev/null +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# command_dev_detect_glibc.sh function +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +# Description: Automatically detects the version of GLIBC that is required. +# Can check a file or directory recursively. + +echo "=================================" +echo "GLIBC Requirements Checker" +echo "=================================" + +if [ -z "${filesdir}" ]; then + dir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +fi + +if [ -d "${filesdir}" ]; then + echo "Checking directory: " + echo "${filesdir}" +elif [ -f "${filesdir}" ]; then + echo "Checking file: " + echo "${filesdir}" +fi +echo "" + +find ${filesdir} -type f -print0 | +while IFS= read -r -d $'\0' line; do + objdump -T $line 2>/dev/null|grep -oP "GLIBC[^ ]+" >>"${lgsmdir}/tmp/detect_glibc.tmp" +done + +cat "${lgsmdir}/tmp/detect_glibc.tmp"|sort|uniq|sort -r --version-sort +rm "${lgsmdir}/tmp/detect_glibc.tmp" \ No newline at end of file diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index ac0cd0fa6..71a2ecff5 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Creates a FastDL folder +# Description: Creates a FastDL folder. local commandname="FASTDL" local commandaction="FastDL" @@ -305,15 +305,15 @@ fn_fastdl_bzip2(){ fn_fastdl_completed(){ # Finished message echo "" - fn_print_ok "Congratulations, it's done !" + fn_print_ok "Congratulations, it's done!" fn_script_log "FastDL job done" sleep 2 echo -en "\n" echo "" - fn_print_info "Need more doc ? See https://github.com/dgibbs64/linuxgsm/wiki/FastDL" + fn_print_info "Need more documentation? See https://github.com/dgibbs64/linuxgsm/wiki/FastDL" echo -en "\n" if [ "$bzip2installed" == "0" ]; then - echo "By the way, you'd better install bzip2 an re-run this command !" + echo "By the way, you'd better install bzip2 and re-run this command!" fi echo "Credits : UltimateByte" } diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index 6d2bcf40e..ac66e96e4 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_install.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Overall function for the installer. @@ -17,7 +18,7 @@ check_deps.sh if [ "${gamename}" == "Unreal Tournament 2004" ]; then install_server_files.sh install_ut2k4_key.sh -elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]; then installer=1 install_server_files.sh elif [ -n "${appid}" ]; then @@ -29,10 +30,10 @@ fi install_config.sh if [ "${gamename}" == "Counter Strike: Global Offensive" ]||[ "${gamename}" == "Team Fortress 2" ]||[ "${gamename}" == "BrainBread 2" ]; then install_gslt.sh -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then install_ts3db.sh fi fix.sh install_complete.sh -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 44e8506e7..0d9a916c1 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -1,8 +1,9 @@ #!/bin/bash # LGSM command_monitor.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Monitors server by checking for running proccesses +# Description: Monitors server by checking for running processes. # then passes to monitor_gsquery.sh. local commandname="MONITOR" @@ -54,6 +55,23 @@ fn_monitor_teamspeak3(){ fi } +fn_monitor_mumble(){ + if [ "${status}" != "0" ]; then + fn_print_ok "Checking session: " + fn_print_ok_eol_nl + fn_script_log_pass "Checking session: OK" + else + fn_print_error "Checking session: Not listening to port ${port}" + fn_print_fail_eol_nl + fn_script_log_error "Checking session: Not listening to port ${port}" + failurereason="Checking session: Not listening to port ${port}" + alert="restart" + alert.sh + fn_script_log_info "Monitor is starting ${servername}" + sleep 1 + command_restart.sh + fi +} fn_monitor_tmux(){ # checks that tmux session is running if [ "${status}" != "0" ]; then @@ -90,9 +108,11 @@ info_config.sh fn_monitor_check_lockfile fn_monitor_check_update fn_monitor_msg_checking -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then fn_monitor_teamspeak3 +elif [ "${gamename}" == "Mumble" ]; then + fn_monitor_mumble else fn_monitor_tmux fi -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index 9e1a2142f..eacebaaea 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -1,8 +1,8 @@ #!/bin/bash -# LGSM command_start.sh function +# LGSM command_restart.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Starts the server. +# Description: Restarts the server. local commandname="RESTART" local commandaction="Restarting" diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 288c79e73..f7f324bf1 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_start.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Starts the server. @@ -177,9 +178,9 @@ if [ "${status}" == "0" ]; then fi fi -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then fn_start_teamspeak3 else fn_start_tmux fi -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index f1c333dee..572225c18 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_stop.sh function # Author: Daniel Gibbs +# Contributors: UltimateByte # Website: https://gameservermanagers.com # Description: Stops the server. @@ -208,7 +209,24 @@ fn_stop_teamspeak3(){ fn_script_log_pass "Stopped ${servername}" else fn_print_fail_nl "Unable to stop ${servername}" - fn_script_log_fail "Unable to stop ${servername}" + fn_script_log_error "Unable to stop ${servername}" + fi +} + +fn_stop_mumble(){ + fn_print_dots "Stopping ${servername}" + mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep 64738 | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') + kill ${mumblepid} + sleep 1 + check_status.sh + if [ "${status}" == "0" ]; then + # Remove lock file + rm -f "${rootdir}/${lockselfname}" + fn_stop_tmux + fn_script_log_pass "Stopped ${servername}" + else + fn_print_fail_nl "Unable to stop ${servername}" + fn_script_log_error "Unable to stop ${servername}" fi } @@ -239,7 +257,7 @@ fn_stop_tmux(){ # checks if the server is already stopped before trying to stop. fn_stop_pre_check(){ - if [ "${gamename}" == "Teamspeak 3" ]; then + if [ "${gamename}" == "TeamSpeak 3" ]; then check_status.sh if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" @@ -247,8 +265,14 @@ fn_stop_pre_check(){ else fn_stop_teamspeak3 fi + elif [ "${gamename}" == "Mumble" ]; then + if [ "${status}" == "0" ]; then + fn_print_info_nl "${servername} is already stopped" + fn_script_log_error "${servername} is already stopped" + else + fn_stop_mumble + fi else - check_status.sh if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" fn_script_log_error "${servername} is already stopped" @@ -263,4 +287,4 @@ sleep 1 check.sh info_config.sh fn_stop_pre_check -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index 3f66c6400..2f9749200 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -2,7 +2,7 @@ # LGSM command_test_alert.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Sends a test email alert. +# Description: Sends a test alert. local commandname="ALERT" local commandaction="Alert" diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index bc65de444..e260b8a2a 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributor : UltimateByte # Website: https://gameservermanagers.com -# Description: Changes TS3 serveradmin password +# Description: Changes TS3 serveradmin password. local commandname="TS3-CHANGE-PASS" local commandaction="TS3 Change Password" diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index e0fde4a0b..d282cc432 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -13,10 +13,12 @@ sleep 0.5 check.sh -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then update_ts3.sh +elif [ "${gamename}" == "Mumble" ]; then + update_mumble.sh else update_steamcmd.sh fi -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_update_functions.sh b/lgsm/functions/command_update_functions.sh index 0c9c7b803..538a8dee8 100644 --- a/lgsm/functions/command_update_functions.sh +++ b/lgsm/functions/command_update_functions.sh @@ -13,7 +13,7 @@ check.sh fn_script_log_info "Updating functions" echo -ne "\n" -# Removed legecy functions dir +# Removed legacy functions dir if [ -n "${rootdir}" ]; then if [ -d "${rootdir}/functions/" ]; then rm -rfv "${rootdir}/functions/" @@ -26,7 +26,7 @@ if [ -n "${functionsdir}" ]; then cd "${functionsdir}" for functionfile in * do - # Check curl exists and use available path + # Check if curl exists and use available path curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" for curlcmd in ${curlpaths} do diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index 2054396ce..65b68dad5 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -19,14 +19,14 @@ fn_validation(){ cd "${rootdir}/steamcmd" - if [ $(command -v stdbuf) ]; then + if [ $(command -v stdbuf) ]; then unbuffer="stdbuf -i0 -o0 -e0" fi if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +app_update "${appid}" validate +quit| tee -a "${scriptlog}" + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit| tee -a "${scriptlog}" else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit| tee -a "${scriptlog}" + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit| tee -a "${scriptlog}" fi if [ $? != 0 ]; then fn_print_fail_nl "Validating files: SteamCMD" @@ -39,7 +39,7 @@ fn_validation(){ } -fn_print_dots_nl "Validating files:" +fn_print_dots "Validating files:" sleep 0.5 fn_print_dots_nl "Validating files: SteamCMD" sleep 1 @@ -47,11 +47,11 @@ check.sh check_status.sh if [ "${status}" != "0" ]; then exitbypass=1 - command_stop.sh - fn_validation - exitbypass=1 - command_start.sh + command_stop.sh + fn_validation + exitbypass=1 + command_start.sh else - fn_validation + fn_validation fi core_exit.sh \ No newline at end of file diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index 0b42b883e..67d3621e2 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -2,7 +2,7 @@ # LGSM compress_unreal2_maps.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: compresses unreal maps +# Description: Compresses unreal maps. local commandaction="Unreal Map Compressor" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh index 899b597d5..3ef6e140e 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -2,7 +2,7 @@ # LGSM compress_ut99_maps.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: compresses unreal maps +# Description: Compresses unreal maps. local commandaction="Unreal Map Compressor" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 2b1ff8053..52155dc49 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM core_dl.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Deals with all downloads for LGSM. @@ -117,11 +118,11 @@ fn_fetch_file(){ if [ ${filename##*.} == "bz2" ]; then echo -ne "downloading ${filename}..." sleep 1 - curlcmd=$(${curlcmd} --progress-bar --fail -o "${filedir}/${filename}" "${fileurl}") + curlcmd=$(${curlcmd} --progress-bar --fail -L -o "${filedir}/${filename}" "${fileurl}") echo -ne "downloading ${filename}..." else echo -ne " fetching ${filename}...\c" - curlcmd=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${fileurl}" 2>&1) + curlcmd=$(${curlcmd} -s --fail -L -o "${filedir}/${filename}" "${fileurl}" 2>&1) fi local exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -129,8 +130,8 @@ fn_fetch_file(){ if [ -f "${scriptlog}" ]; then fn_script_log_fatal "downloading ${filename}: FAIL" fi + echo -e "${fileurl}" | tee -a "${scriptlog}" echo "${curlcmd}" | tee -a "${scriptlog}" - echo -e "${fileurl}\n" | tee -a "${scriptlog}" core_exit.sh else fn_print_ok_eol_nl @@ -207,6 +208,7 @@ fn_fetch_function(){ } fn_update_function(){ + exitbypass=1 github_file_url_dir="lgsm/functions" # github dir containing the file github_file_url_name="${functionfile}" # name of the github file githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" @@ -218,4 +220,4 @@ fn_update_function(){ force="noforce" md5="nomd5" fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" -} \ No newline at end of file +} diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index 13f4a5cc5..d5f17dfe5 100644 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -2,7 +2,7 @@ # LGSM core_exit.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: handles exiting of LGSM by running and reporting an exit code. +# Description: Handles exiting of LGSM by running and reporting an exit code. fn_exit_dev_debug(){ if [ -f "${rootdir}/.dev-debug" ]; then @@ -35,4 +35,3 @@ else trap - INT exit ${exitcode} fi - diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 2dda20940..e1e6cbbc7 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -5,8 +5,16 @@ # Description: Defines all functions to allow download and execution of functions using fn_fetch_function. # This function is called first before any other function. Without this file other functions will not load. -# Code/functions for legacy servers +# Fixes for legacy code +if [ "${gamename}" == "Teamspeak 3" ]; then + gamename="TeamSpeak 3" +fi + +if [ "${emailnotification}" == "on" ]; then + emailalert="on" +fi +# Code/functions for legacy servers fn_functions(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -17,9 +25,8 @@ functionfile="${FUNCNAME}" fn_fetch_function } - -# fn_fetch_core_dl also placed here to allow legecy servers to still download core functions -if [ -z "${lgsmdir}" ]; then +# fn_fetch_core_dl also placed here to allow legacy servers to still download core functions +if [ -z "${lgsmdir}" ]||[ -z "${functionsdir}" ]||[ -z "${libdir}" ]; then lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" @@ -258,6 +265,10 @@ functionfile="${FUNCNAME}" fn_fetch_function } +command_dev_detect_glibc.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Fix @@ -385,6 +396,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +update_mumble.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + update_steamcmd.sh(){ functionfile="${FUNCNAME}" fn_fetch_function diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 772a5a4b3..4c6514bdd 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -43,6 +43,8 @@ case "${getopt}" in fn_autoinstall;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -87,7 +89,7 @@ case "${getopt}" in command_update_functions.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -103,6 +105,8 @@ case "${getopt}" in fn_autoinstall;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -138,22 +142,26 @@ case "${getopt}" in command_stop.sh;; r|restart) command_restart.sh;; + u|update) + command_update.sh;; uf|update-functions) command_update_functions.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; + dt|details) + command_details.sh;; b|backup) command_backup.sh;; dev|dev-debug) command_dev_debug.sh;; - console) - command_console.sh;; - d|debug) - command_debug.sh;; + i|install) + command_install.sh;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -168,12 +176,13 @@ case "${getopt}" in echo -e "${blue}start\t${default}st |Start the server." echo -e "${blue}stop\t${default}sp |Stop the server." echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." echo -e "${blue}monitor\t${default}m |Checks that the server is running." echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." } | column -s $'\t' -t esac } @@ -197,7 +206,7 @@ case "${getopt}" in command_validate.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -215,6 +224,8 @@ case "${getopt}" in fn_autoinstall;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; fd|fastdl) command_fastdl.sh;; *) @@ -231,7 +242,7 @@ case "${getopt}" in echo -e "${blue}start\t${default}st |Start the server." echo -e "${blue}stop\t${default}sp |Stop the server." echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}Checks and applies updates from SteamCMD." + echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." @@ -260,7 +271,7 @@ case "${getopt}" in command_update_functions.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -280,6 +291,8 @@ case "${getopt}" in compress_ut99_maps.sh;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -328,7 +341,7 @@ case "${getopt}" in command_validate.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -346,6 +359,8 @@ case "${getopt}" in fn_autoinstall;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; mc|map-compressor) compress_unreal2_maps.sh;; *) @@ -392,7 +407,7 @@ case "${getopt}" in command_update_functions.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -414,6 +429,8 @@ case "${getopt}" in compress_unreal2_maps.sh;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -445,7 +462,7 @@ case "${getopt}" in if [ "${gamename}" == "Mumble" ]; then fn_getopt_mumble -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then fn_getopt_teamspeak3 elif [ "${gamename}" == "Garry's Mod" ]; then fn_getopt_gmodserver @@ -460,4 +477,4 @@ elif [ "${engine}" == "unreal" ]; then else fn_getopt_generic fi -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 2118843c6..97f609f50 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -25,59 +25,71 @@ fi ########## ## Feb 28 14:56:58 ut99-server: Monitor: fn_script_log(){ - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ${1}" >> "${scriptlog}" - else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}" + if [ -d "${scriptlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ${1}" >> "${scriptlog}" + else + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}" + fi fi } ## Feb 28 14:56:58 ut99-server: Monitor: PASS: fn_script_log_pass(){ - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: PASS: ${1}" >> "${scriptlog}" - else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: PASS: ${1}" >> "${scriptlog}" + if [ -d "${scriptlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: PASS: ${1}" >> "${scriptlog}" + else + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: PASS: ${1}" >> "${scriptlog}" + fi fi exitcode=0 } ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: fn_script_log_fatal(){ - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: FATAL: ${1}" >> "${scriptlog}" - else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: FATAL: ${1}" >> "${scriptlog}" + if [ -d "${scriptlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: FATAL: ${1}" >> "${scriptlog}" + else + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: FATAL: ${1}" >> "${scriptlog}" + fi fi exitcode=1 } ## Feb 28 14:56:58 ut99-server: Monitor: ERROR: fn_script_log_error(){ - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ERROR: ${1}" >> "${scriptlog}" - else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ERROR: ${1}" >> "${scriptlog}" + if [ -d "${scriptlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ERROR: ${1}" >> "${scriptlog}" + else + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ERROR: ${1}" >> "${scriptlog}" + fi fi exitcode=2 } ## Feb 28 14:56:58 ut99-server: Monitor: WARN: fn_script_log_warn(){ - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: WARN: ${1}" >> "${scriptlog}" - else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: WARN: ${1}" >> "${scriptlog}" + if [ -d "${scriptlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: WARN: ${1}" >> "${scriptlog}" + else + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: WARN: ${1}" >> "${scriptlog}" + fi fi exitcode=3 } ## Feb 28 14:56:58 ut99-server: Monitor: INFO: fn_script_log_info(){ - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: INFO: ${1}" >> "${scriptlog}" - else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: INFO: ${1}" >> "${scriptlog}" + if [ -d "${scriptlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: INFO: ${1}" >> "${scriptlog}" + else + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: INFO: ${1}" >> "${scriptlog}" + fi fi } diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh index e53236410..46615cfe5 100644 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -2,12 +2,12 @@ # LGSM core_trap.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: handles ctrl-C trap to give an exitcode. +# Description: Handles CTRL-C trap to give an exit code. fn_exit_trap(){ echo "" core_exit.sh } -# trap to give an exitcode. +# trap to give an exit code. trap fn_exit_trap INT \ No newline at end of file diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 6a69bd759..f31c010d7 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -44,10 +44,6 @@ if [ "${function_selfname}" != "command_install.sh" ]; then elif [ "${gamename}" == "ARMA 3" ]; then fix_arma3.sh fi - - if [ "${gamename}" != "Teamspeak 3" ]; then - fix_glibc.sh - fi fi # Fixes that are run on install only. diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh index a98d9e17e..38d169532 100644 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/functions/fix_csgo.sh @@ -2,7 +2,7 @@ # LGSM fix_csgo.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Resolves various issues with csgo. +# Description: Resolves various issues with CS:GO. local commandname="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh index 2ffb0a354..fea58b67e 100644 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/functions/fix_dst.sh @@ -2,7 +2,7 @@ # LGSM fix_dst.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Resolves various issues with Dont Starve together. +# Description: Resolves various issues with Don't Starve Together. local commandname="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_glibc.sh b/lgsm/functions/fix_glibc.sh index f9606bdc9..5abe1ea28 100644 --- a/lgsm/functions/fix_glibc.sh +++ b/lgsm/functions/fix_glibc.sh @@ -2,7 +2,7 @@ # LGSM fix_glibc.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Downloads required glibc files and applys teh glibc fix if required +# Description: Downloads required Glibc files and applies the Glibc fix if required. local commandname="FIX" local commandaction="Fix" @@ -16,7 +16,7 @@ do fi done -local libm_servers_array=( "Double Action: Boogaloo" "Fistful of Frags" "Insurgency" "Natural Selection 2" "NS2: Combat" "No More Room in Hell" ) +local libm_servers_array=( "Codename CURE" "Day of Infamy" "Double Action: Boogaloo" "Empires Mod" "Fistful of Frags" "Garry's Mod" "Insurgency" "Natural Selection 2" "NS2: Combat" "No More Room in Hell" ) for libm_server in "${libm_servers_array[@]}" do if [ "${gamename}" == "${libm_server}" ]; then @@ -24,4 +24,20 @@ do fi done +local libc_servers_array=( "Garry's Mod" ) +for libc_server in "${libc_servers_array[@]}" +do + if [ "${gamename}" == "${libc_server}" ]; then + fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libc.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5" + fi +done + +local libpthread_servers_array=( "Garry's Mod" ) +for libpthread_server in "${libpthread_servers_array[@]}" +do + if [ "${gamename}" == "${libpthread_server}" ]; then + fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libpthread.so.0" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5" + fi +done + export LD_LIBRARY_PATH=:"${libdir}" \ No newline at end of file diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index c4d023ee6..9f08fd36a 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -2,7 +2,7 @@ # LGSM fix_steamcmd.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Resolves various issues related to steamCMD. +# Description: Resolves various issues related to SteamCMD. local commandname="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fn_functions b/lgsm/functions/fn_functions index ee9891cb6..0d024beb1 100644 --- a/lgsm/functions/fn_functions +++ b/lgsm/functions/fn_functions @@ -4,7 +4,7 @@ # Website: https://gameservermanagers.com lgsm_version="210516" -# Description: Redirect to new core_functions.sh +# Description: Redirects to new core_functions.sh core_functions.sh(){ # Functions are defined in core_functions.sh. diff --git a/lgsm/functions/gsquery.py b/lgsm/functions/gsquery.py index 8102e28a7..76d5478d9 100644 --- a/lgsm/functions/gsquery.py +++ b/lgsm/functions/gsquery.py @@ -18,23 +18,23 @@ class GameServer: self.default_buffer_length = 1024 # if self.option.engine == 'source': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' + self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' elif self.option.engine == 'goldsource': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' + self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' elif self.option.engine == 'spark': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' + self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' elif self.option.engine == 'realvirtuality': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' + self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' elif self.option.engine == 'unity3d': self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' elif self.option.engine == 'idtech3': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' + self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' elif self.option.engine == 'unreal': - self.query_prompt_string = '\x5C\x69\x6E\x66\x6F\x5C' + self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C' elif self.option.engine == 'unreal2': - self.query_prompt_string = '\x79\x00\x00\x00\x00' + self.query_prompt_string = b'\x79\x00\x00\x00\x00' elif self.option.engine == 'avalanche': - self.query_prompt_string = '\xFE\xFD\x09\x10\x20\x30\x40' + self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' self.connected = False self.response = None self.sanity_checks() diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index cdc6e5785..1f754d62d 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM info_config.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Gets specific details from config files. @@ -70,17 +71,26 @@ fn_info_config_dontstarve(){ fn_info_config_projectzomboid(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" slots="${zero}" port="${zero}" + gameworld="${unavailable}" else - servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '=", \n') + servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '\') + serverpassword=$(grep "^Password=$" "${servercfgfullpath}" | sed 's/Password=//g' | tr -d '\') + rconpassword=$(grep "RCONPassword=" "${servercfgfullpath}" | sed 's/RCONPassword=//g' | tr -d '\') slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + gameworld=$(grep "Map=" "${servercfgfullpath}" | sed 's/Map=//g' | tr -d '\n') # Not Set servername=${servername:-"NOT SET"} - slots=${slots:-"0"} - port=${port:-"0"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + slots=${slots:-"NOT SET"} + port=${port:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} fi } @@ -211,6 +221,28 @@ fn_info_config_teamspeak3(){ fi } +fn_info_config_mumble(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="64738" + queryport="${port}" + servername="Mumble" + else + # check if the ip exists in the config file. Failing this will fall back to the default. + ipconfigcheck=$(cat "${servercfgfullpath}" | grep "host=" | awk -F'=' '{ print $2}') + if [ -n "${ipconfigcheck}" ]; then + ip="${ipconfigcheck}" + fi + port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') + queryport="${port}" + + # Not Set + port=${port:-"64738"} + queryport=${queryport:-"64738"} + + servername="Mumble Port ${port}" + fi +} + fn_info_config_teeworlds(){ if [ ! -f "${servercfgfullpath}" ]; then servername="unnamed server" @@ -293,7 +325,7 @@ fn_info_config_unreal(){ webadminpass=${webadminpass:-"NOT SET"} fi } - + fn_info_config_sdtd(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -316,7 +348,7 @@ fn_info_config_sdtd(){ queryport=$((port + 1)) webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') @@ -366,8 +398,11 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then # Starbound elif [ "${engine}" == "starbound" ]; then fn_info_config_starbound -elif [ "${gamename}" == "Teamspeak 3" ]; then +# TeamSpeak 3 +elif [ "${gamename}" == "TeamSpeak 3" ]; then fn_info_config_teamspeak3 +elif [ "${gamename}" == "Mumble" ]; then + fn_info_config_mumble # Teeworlds elif [ "${engine}" == "teeworlds" ]; then fn_info_config_teeworlds diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 02a2c0488..4f3012730 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -14,13 +14,21 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" arch=$(uname -m) kernel=$(uname -r) if [ -n "$(command -v lsb_release)" ]; then - os=$(lsb_release -s -d) + distroname=$(lsb_release -s -d) +elif [ -f "/etc/os-release" ]; then + distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="') elif [ -f "/etc/debian_version" ]; then - os="Debian $(cat /etc/debian_version)" + distroname="Debian $(cat /etc/debian_version)" elif [ -f "/etc/redhat-release" ]; then - os=$(cat /etc/redhat-release) + distroname=$(cat /etc/redhat-release) else - os="$(uname -s) $(uname -r)" + distroname="$(uname -s) $(uname -r)" +fi + +if [ -f "/etc/os-release" ]; then + distroversion=$(grep VERSION_ID /etc/os-release | tr -cd '[:digit:]') +elif [ -n "$(command -v yum)" ]; then + distroversion=$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos" | cut -d"-" -f3) fi ## Glibc version @@ -31,7 +39,7 @@ glibcversion="$(ldd --version | sed -n '1s/.* //p')" # e.g: tmux 1.6 if [ -z "$(command -v tmux)" ]; then tmuxv="${red}NOT INSTALLED!${default}" -elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then +elif [ "$(tmux -V|sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')" -lt "16" ]; then tmuxv="$(tmux -V) (>= 1.6 required for console log)" else tmuxv=$(tmux -V) diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index 2a1adc058..2a2f289bc 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -2,7 +2,7 @@ # LGSM info_glibc.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: stores details on servers Glibc requirements. +# Description: Stores details on servers Glibc requirements. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" @@ -11,9 +11,15 @@ if [ "${gamename}" == "Blade Symphony" ]; then glibcfix="yes" elif [ "${gamename}" == "BrainBread 2" ]; then glibcrequired="2.17" +elif [ "${gamename}" == "Day of Infamy" ]; then + glibcrequired="2.15" + glibcfix="yes" elif [ "${gamename}" == "Double Action: Boogaloo" ]; then glibcrequired="2.15" glibcfix="yes" +elif [ "${gamename}" == "Empires Mod" ]; then + glibcrequired="2.15" + glibcfix="yes" elif [ "${gamename}" == "Fistful of Frags" ]; then glibcrequired="2.15" glibcfix="yes" @@ -37,7 +43,7 @@ elif [ "${engine}" == "dontstarve" ]; then glibcfix="no" elif [ "${engine}" == "projectzomboid" ]; then glibcrequired="2.15" - glibcfix="yesno" + glibcfix="no" elif [ "${engine}" == "realvirtuality" ]; then glibcrequired="2.13" glibcfix="yes" @@ -68,7 +74,10 @@ elif [ "${engine}" == "unreal4" ]; then elif [ "${engine}" == "unity3d" ]; then glibcrequired="2.15" glibcfix="no" -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then + glibcrequired="NOT REQUIRED" + glibcfix="no" +elif [ "${gamename}" == "Mumble" ]; then glibcrequired="NOT REQUIRED" glibcfix="no" else diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 070a52260..81aa3c676 100644 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -143,6 +143,7 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then # Teeworlds elif [ "${engine}" == "teeworlds" ]; then fn_info_config_teeworlds +# Terraria elif [ "${engine}" == "terraria" ]; then fn_info_config_terraria # Unreal/Unreal 2 engine diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh index a0680bcda..af522d2ee 100644 --- a/lgsm/functions/install_complete.sh +++ b/lgsm/functions/install_complete.sh @@ -2,6 +2,7 @@ # LGSM install_complete.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Prints installation completion message and hints. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 11888df05..90ebb2ff1 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -2,6 +2,7 @@ # LGSM install_config.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Creates default server configs. local commandname="INSTALL" local commandaction="Install" @@ -246,7 +247,7 @@ elif [ "${gamename}" == "Day of Infamy" ]; then fn_sourceconfig elif [ "${gamename}" == "Don't Starve Together" ]; then echo -e "downloading lgsm-default.ini...\c" - wget -N /dev/null ${githuburl}/DontStarveTogether/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq + wget -N /dev/null ${githuburl}/DontStarveTogether/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_defaultconfig elif [ "${gamename}" == "Double Action: Boogaloo" ]; then @@ -254,6 +255,8 @@ elif [ "${gamename}" == "Double Action: Boogaloo" ]; then wget -N /dev/null ${githuburl}/DoubleActionBoogaloo/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_sourceconfig +elif [ "${gamename}" == "Empires Mod" ]; then + fn_defaultconfig elif [ "${gamename}" == "Fistful of Frags" ]; then echo -e "downloading lgsm-default.cfg...\c" wget -N /dev/null ${githuburl}/FistfulOfFrags/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq @@ -346,7 +349,7 @@ elif [ "${gamename}" == "Starbound" ]; then sleep 1 fn_defaultconfig fn_userinputconfig -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then echo -e "downloading lgsm-default.ini...\c" wget -N /dev/null ${githuburl}/TeamSpeak3/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh index f0a706830..3bbe063e0 100644 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/functions/install_gslt.sh @@ -12,7 +12,7 @@ echo "" echo "Game Server Login Token" echo "=================================" sleep 1 -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then +if [ "${gamename}" == "Counter Strike: Global Offensive" ]||[ "${gamename}" == "Counter Strike: Source" ]; then echo "GSLT is required to run a public ${gamename} server" fn_script_log_info "GSLT is required to run a public ${gamename} server" else diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh index 3f2e5f0e1..499d1aec9 100644 --- a/lgsm/functions/install_header.sh +++ b/lgsm/functions/install_header.sh @@ -2,6 +2,7 @@ # LGSM install_header.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Prints installation header. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index 59446681a..abad81329 100644 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -2,6 +2,7 @@ # LGSM install_logs.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Creates log directories. local commandname="INSTALL" local commandaction="Install" @@ -22,8 +23,8 @@ if [ -n "${consolelogdir}" ]; then touch "${consolelog}" fi -# If a server is source or goldsource, Teamspeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs. -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "Teamspeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]||[ "${engine}" == "unreal" ]; then +# If a server is source or goldsource, TeamSpeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs. +if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]||[ "${engine}" == "unreal" ]; then if [ ! -h "${rootdir}/log/server" ]; then ln -nfsv "${gamelogdir}" "${rootdir}/log/server" fi diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh index 661b57f39..d0ca16fef 100644 --- a/lgsm/functions/install_retry.sh +++ b/lgsm/functions/install_retry.sh @@ -2,6 +2,7 @@ # LGSM install_retry.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Asks for installation retry after failure. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index 2ac93d2fb..d527b6193 100644 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -2,6 +2,7 @@ # LGSM install_server_dir.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Creates the server directory. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index d881a2717..8f05a01a8 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -2,6 +2,7 @@ # LGSM install_server_files.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Installs server files. local commandname="INSTALL" local commandaction="Install" @@ -46,8 +47,8 @@ fn_install_server_files_steamcmd(){ fi # Detects if unbuffer command is available. - if [ $(command -v stdbuf) ]; then - unbuffer="stdbuf -i0 -o0 -e0" + if [ $(command -v stdbuf) ]; then + unbuffer="stdbuf -i0 -o0 -e0" fi if [ "${counter}" -le "4" ]; then @@ -55,7 +56,7 @@ fn_install_server_files_steamcmd(){ ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit local exitcode=$? else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} +quit local exitcode=$? fi elif [ "${counter}" -ge "5" ]; then @@ -63,7 +64,7 @@ fn_install_server_files_steamcmd(){ ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} -validate +quit local exitcode=$? else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} -validate +quit local exitcode=$? fi fi @@ -81,7 +82,7 @@ fn_install_server_files_steamcmd(){ counter="0" while [ "${counter}" -le "4" ]; do counter=$((counter+1)) - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" ${branch} -validate +quit local exitcode=$? done fi @@ -92,8 +93,10 @@ echo "Installing ${gamename} Server" echo "=================================" sleep 1 -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then update_ts3.sh +elif [ "${gamename}" == "Mumble" ]; then + update_mumble.sh elif [ -z "${appid}" ]||[ "${gamename}" == "GoldenEye: Source" ]; then fn_install_server_files fi diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index 90006538f..bada12c0b 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -3,6 +3,7 @@ # Author: Daniel Gibbs # Contributor: PhilPhonic # Website: https://gameservermanagers.com +# Description: Installs the database server MariaDB for TeamSpeak 3. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh index ba2a7634e..b091faff3 100644 --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/functions/install_ut2k4_key.sh @@ -2,6 +2,7 @@ # LGSM install_ut2k4_key.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Activates ut2k4 server with given key. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/monitor_gsquery.sh b/lgsm/functions/monitor_gsquery.sh index c28bed3bb..02ce17ab4 100644 --- a/lgsm/functions/monitor_gsquery.sh +++ b/lgsm/functions/monitor_gsquery.sh @@ -2,14 +2,14 @@ # LGSM monitor_gsquery.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: uses gsquery.py to query the server port. -# Detects if the server has frozen with the proccess still running. +# Description: Uses gsquery.py to query the server port. +# Detects if the server has frozen with the process still running. local commandname="MONITOR" local commandaction="Monitor" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -# Forces legecy servers to use gsquery +# Forces legacy servers to use gsquery if [ -z "${gsquery}" ]; then gsquery="yes" fi diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh new file mode 100644 index 000000000..ba4b6f3ce --- /dev/null +++ b/lgsm/functions/update_mumble.sh @@ -0,0 +1,165 @@ +#!/bin/bash +# LGSM update_mumble.sh function +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://gameservermanagers.com +# Description: Handles updating of mumble servers. + +local commandname="UPDATE" +local commandaction="Update" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" + +fn_update_mumble_dl(){ + fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/murmur-static_${mumblearch}-${availablebuild}.tar.bz2" "${lgsmdir}/tmp" "murmur-static_${mumblearch}-${availablebuild}.tar.bz2" + fn_dl_extract "${lgsmdir}/tmp" "murmur-static_${mumblearch}-${availablebuild}.tar.bz2" "${lgsmdir}/tmp" + echo -e "copying to ${filesdir}...\c" + fn_script_log "Copying to ${filesdir}" + cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${availablebuild}/"* "${filesdir}" + local exitcode=$? + if [ ${exitcode} -eq 0 ]; then + fn_print_ok_eol_nl + else + fn_print_fail_eol_nl + fi +} + +fn_update_mumble_currentbuild(){ + # Gets current build info + # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. + if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then + fn_print_error "Checking for update: GitHub" + sleep 1 + fn_print_error_nl "Checking for update: GitHub: No logs with server version found" + fn_script_log_error "Checking for update: GitHub: No logs with server version found" + sleep 1 + fn_print_info_nl "Checking for update: GitHub: Forcing server restart" + fn_script_log_info "Checking for update: GitHub: Forcing server restart" + sleep 1 + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + sleep 1 + # Check again and exit on failure. + if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then + fn_print_fail_nl "Checking for update: GitHub: Still No logs with server version found" + fn_script_log_fatal "Checking for update: GitHub: Still No logs with server version found" + core_exit.sh + fi + fi + + # Get current build from logs + currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') + if [ -z "${currentbuild}" ]; then + fn_print_error_nl "Checking for update: GitHub: Current build version not found" + fn_script_log_error "Checking for update: GitHub: Current build version not found" + sleep 1 + fn_print_info_nl "Checking for update: GitHub: Forcing server restart" + fn_script_log_info "Checking for update: GitHub: Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') + if [ -z "${currentbuild}" ]; then + fn_print_fail_nl "Checking for update: GitHub: Current build version still not found" + fn_script_log_fatal "Checking for update: GitHub: Current build version still not found" + core_exit.sh + fi + fi +} + +fn_update_mumble_arch(){ + # Mumble is x86 only for now + mumblearch="x86" +} + +fn_update_mumble_availablebuild(){ + # Gets latest build info. + availablebuild=$(curl -s https://api.github.com/repos/mumble-voip/mumble/releases/latest | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') + sleep 1 + + # Checks if availablebuild variable has been set + if [ -z "${availablebuild}" ]; then + fn_print_fail "Checking for update: GitHub" + sleep 1 + fn_print_fail "Checking for update: GitHub: Not returning version info" + fn_script_log_fatal "Failure! Checking for update: GitHub: Not returning version info" + core_exit.sh + else + fn_print_ok_nl "Checking for update: GitHub" + fn_script_log_pass "Checking for update: GitHub" + sleep 1 + fi +} + +fn_update_mumble_compare(){ + # Removes dots so if can compare version numbers + currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') + availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') + + if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then + echo -e "\n" + echo -e "Update available:" + sleep 1 + echo -e " Current build: ${red}${currentbuild} ${mumblearch}${default}" + echo -e " Available build: ${green}${availablebuild} ${mumblearch}${default}" + echo -e "" + sleep 1 + echo "" + echo -en "Applying update.\r" + sleep 1 + echo -en "Applying update..\r" + sleep 1 + echo -en "Applying update...\r" + sleep 1 + echo -en "\n" + fn_script_log "Update available" + fn_script_log "Current build: ${currentbuild}" + fn_script_log "Available build: ${availablebuild}" + fn_script_log "${currentbuild} > ${availablebuild}" + + unset updateonstart + + check_status.sh + if [ "${status}" == "0" ]; then + fn_update_mumble_dl + exitbypass=1 + command_start.sh + exitbypass=1 + command_stop.sh + else + exitbypass=1 + command_stop.sh + fn_update_mumble_dl + exitbypass=1 + command_start.sh + fi + alert="update" + alert.sh + else + echo -e "\n" + echo -e "No update available:" + echo -e " Current version: ${green}${currentbuild}${default}" + echo -e " Available version: ${green}${availablebuild}${default}" + echo -e "" + fn_print_ok_nl "No update available" + fn_script_log_info "Current build: ${currentbuild}" + fn_script_log_info "Available build: ${availablebuild}" + fi +} + + +fn_update_mumble_arch +if [ "${installer}" == "1" ]; then + fn_update_mumble_availablebuild + fn_update_mumble_dl +else + # Checks for server update from github.com + fn_print_dots "Checking for update: github.com" + fn_script_log_info "Checking for update: github.com" + sleep 1 + fn_update_mumble_currentbuild + fn_update_mumble_availablebuild + fn_update_mumble_compare +fi diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 31c022eb3..574fbe2b9 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -2,7 +2,7 @@ # LGSM update_steamcmd.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description:Handles updating using steamCMD. +# Description: Handles updating using SteamCMD. local commandname="UPDATE" local commandaction="Update" @@ -24,9 +24,9 @@ fn_update_steamcmd_dl(){ fi if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +quit | tee -a "${scriptlog}" + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" ${branch} +quit | tee -a "${scriptlog}" else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit | tee -a "${scriptlog}" + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} +quit | tee -a "${scriptlog}" fi fix.sh diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 3745eed49..e4ee2ddc6 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -47,6 +47,7 @@ fn_update_ts3_currentbuild(){ fi fi + # Get current build from logs currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') if [ -z "${currentbuild}" ]; then fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found" @@ -76,52 +77,52 @@ elif [ "${arch}" == "i386" ]||[ "${arch}" == "i686" ]; then ts3arch="x86" else echo "" - fn_print_failure "unknown or unsupported architecture: ${arch}" - fn_script_log_fatal "unknown or unsupported architecture: ${arch}" + fn_print_failure "Unknown or unsupported architecture: ${arch}" + fn_script_log_fatal "Unknown or unsupported architecture: ${arch}" core_exit.sh fi } fn_update_ts3_availablebuild(){ -# Gets availablebuild info. + # Gets latest build info. -# Creates tmp dir if missing -if [ ! -d "${lgsmdir}/tmp" ]; then - mkdir -p "${lgsmdir}/tmp" -fi + # Creates tmp dir if missing + if [ ! -d "${lgsmdir}/tmp" ]; then + mkdir -p "${lgsmdir}/tmp" + fi -# Grabs all version numbers but not in correct order. -wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" + # Grabs all version numbers but not in correct order. + wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" -# Sort version numbers -cat "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" | sort -r --version-sort -o "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" + # Sort version numbers + cat "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" | sort -r --version-sort -o "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" -# Finds directory with most recent server version. -while read ts3_version_number; do - wget --spider -q "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" - if [ $? -eq 0 ]; then - availablebuild="${ts3_version_number}" - # Break while-loop, if the latest release could be found. - break - fi -done < "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" + # Finds directory with most recent server version. + while read ts3_version_number; do + wget --spider -q "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" + if [ $? -eq 0 ]; then + availablebuild="${ts3_version_number}" + # Break while-loop, if the latest release could be found. + break + fi + done < "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" -# Tidy up -rm -f "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" -rm -f "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" + # Tidy up + rm -f "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" + rm -f "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" -# Checks availablebuild info is available -if [ -z "${availablebuild}" ]; then - fn_print_fail "Checking for update: teamspeak.com" - sleep 1 - fn_print_fail "Checking for update: teamspeak.com: Not returning version info" - fn_script_log_fatal "Failure! Checking for update: teamspeak.com: Not returning version info" - core_exit.sh -else - fn_print_ok_nl "Checking for update: teamspeak.com" - fn_script_log_pass "Checking for update: teamspeak.com" - sleep 1 -fi + # Checks availablebuild info is available + if [ -z "${availablebuild}" ]; then + fn_print_fail "Checking for update: teamspeak.com" + sleep 1 + fn_print_fail "Checking for update: teamspeak.com: Not returning version info" + fn_script_log_fatal "Failure! Checking for update: teamspeak.com: Not returning version info" + core_exit.sh + else + fn_print_ok_nl "Checking for update: teamspeak.com" + fn_script_log_pass "Checking for update: teamspeak.com" + sleep 1 + fi } fn_update_ts3_compare(){ @@ -133,8 +134,8 @@ fn_update_ts3_compare(){ echo -e "\n" echo -e "Update available:" sleep 1 - echo -e " Current build: ${red}${currentbuild} ${architecture}${default}" - echo -e " Available build: ${green}${availablebuild} ${architecture}${default}" + echo -e " Current build: ${red}${currentbuild} ${ts3arch}${default}" + echo -e " Available build: ${green}${availablebuild} ${ts3arch}${default}" echo -e "" sleep 1 echo "" diff --git a/Insurgency/dependencies/libpthread.so.0 b/lgsm/lib/ubuntu12.04/i386/libpthread.so.0 similarity index 99% rename from Insurgency/dependencies/libpthread.so.0 rename to lgsm/lib/ubuntu12.04/i386/libpthread.so.0 index a4bfc2282..a2353e112 100644 Binary files a/Insurgency/dependencies/libpthread.so.0 and b/lgsm/lib/ubuntu12.04/i386/libpthread.so.0 differ diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index cd147a928..7522cd0fe 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -179,19 +179,19 @@ fn_setstatus(){ else (command_stop.sh > /dev/null 2>&1) fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." - exit 1 - fi - done - echo -ne "New status: ${currentstatus}\\r" - echo -e "\n" - echo "Test starting:" - echo "" - sleep 0.5 + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo "Current status: ${currentstatus}" + echo "" + echo "Unable to start or stop server." + exit 1 + fi + done + echo -ne "New status: ${currentstatus}\\r" + echo -e "\n" + echo "Test starting:" + echo "" + sleep 0.5 } # End of every test will expect the result to either pass or fail @@ -465,7 +465,7 @@ echo "" echo "4.8 - validate - online" echo "=================================" echo "Description:" -echo "validate server files while server while already running." +echo "validate server files while server already running." echo "" echo "Command: ./jc2server validate" requiredstatus="ONLINE" @@ -473,6 +473,18 @@ fn_setstatus (command_validate.sh) fn_test_result_pass +echo "" +echo "4.9 - update-functions" +echo "=================================" +echo "Description:" +echo "runs update-functions." +echo "" +echo "Command: ./jc2server update-functions" +requiredstatus="OFFLINE" +fn_setstatus +(command_update_functions.sh) +fn_test_result_pass + echo "" echo "5.1 - monitor - online" echo "=================================" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index b83e1169a..d3406022b 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -168,19 +168,19 @@ fn_setstatus(){ else (command_stop.sh > /dev/null 2>&1) fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." - exit 1 - fi - done - echo -ne "New status: ${currentstatus}\\r" - echo -e "\n" - echo "Test starting:" - echo "" - sleep 0.5 + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo "Current status: ${currentstatus}" + echo "" + echo "Unable to start or stop server." + exit 1 + fi + done + echo -ne "New status: ${currentstatus}\\r" + echo -e "\n" + echo "Test starting:" + echo "" + sleep 0.5 } # End of every test will expect the result to either pass or fail @@ -368,6 +368,7 @@ fn_setstatus (command_restart.sh) fn_test_result_pass +echo "" echo "4.1 - update" echo "=================================" echo "Description:" @@ -378,6 +379,18 @@ fn_setstatus (command_update.sh) fn_test_result_pass +echo "" +echo "4.2 - update-functions" +echo "=================================" +echo "Description:" +echo "runs update-functions." +echo "" +echo "Command: ./jc2server update-functions" +requiredstatus="OFFLINE" +fn_setstatus +(command_update_functions.sh) +fn_test_result_pass + echo "" echo "5.1 - monitor - online" echo "================================="