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 e95f539c6..c735d87ae 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -40,7 +40,7 @@ ip="0.0.0.0" 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 7b942ee32..6e684eba0 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -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}/cstrike" executabledir="${filesdir}" 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/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index 413f896a0..b1b3ceedc 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -94,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/doiserver b/DayOfInfamy/doiserver index 1f313d0c7..3dde94acf 100644 --- a/DayOfInfamy/doiserver +++ 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/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/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 9eb3be966..bc21fda29 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -46,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 @@ -87,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/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 9d48326d1..f92f589e9 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -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}/left4dead2" executabledir="${filesdir}" diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index 628a07ad4..54d0b4e71 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -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}" executabledir="${filesdir}" 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 3c1cc3186..1190f4a12 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -78,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/pzserver b/ProjectZomboid/pzserver index 7cb225c8b..dafab0d38 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -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}" 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 247d80191..c297e8876 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -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/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/lgsm/functions/check.sh b/lgsm/functions/check.sh index 2620af6fc..58a3041d7 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -13,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 @@ -59,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 @@ -83,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_deps.sh b/lgsm/functions/check_deps.sh index f4ffe1f7f..3d81e418b 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -18,10 +18,10 @@ fn_deps_detector(){ if [ "${depstatus}" == "0" ]; then missingdep=0 if [ "${function_selfname}" == "command_install.sh" ]; then - if [ "${tmuxcheck}" != "1" ]; then + if [ "${tmuxcheck}" == "1" ]; then # Added for users compiling tmux from source to bypass rpm check echo -e "${green}tmux${default}" - tmuxcheck=1 + unset tmuxcheck fi echo -e "${green}${deptocheck}${default}" sleep 0.5 @@ -138,12 +138,12 @@ if [ -n "$(command -v dpkg-query)" ]; then array_deps_missing=() # LGSM requirements - array_deps_required=( curl ca-certificates file bsdmainutils util-linux python bzip2 gzip ) + 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 - if [ "$(command -v tmux)" ]||[ "$(which tmux)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then - : # Added for users compiling tmux from source to bypass rpm check + 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 @@ -168,7 +168,11 @@ if [ -n "$(command -v dpkg-query)" ]; then array_deps_required+=( telnet expect ) # 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+=( lib32tinfo5 ) + 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 ) @@ -194,15 +198,15 @@ elif [ -n "$(command -v yum)" ]; then # LGSM requirements if [ "${distroversion}" == "6" ]; then - array_deps_required=( curl util-linux-ng python file gzip bzip2 ) + array_deps_required=( curl wget util-linux-ng python file gzip bzip2 ) else - array_deps_required=( curl util-linux python file gzip bzip2 ) + array_deps_required=( curl wget util-linux python file gzip bzip2 ) fi # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then - if [ "$(command -v tmux)" ]||[ "$(which tmux)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then - : # Added for users compiling tmux from source to bypass rpm check + 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 diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index 9d09042ab..8c1c264c2 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -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_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/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_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/core_dl.sh b/lgsm/functions/core_dl.sh index b8764ddf4..52155dc49 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -130,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 @@ -208,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}" diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index 71580ae4f..d5f17dfe5 100644 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -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 f619eec2a..0c2137642 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -26,7 +26,7 @@ fn_fetch_function } # fn_fetch_core_dl also placed here to allow legacy servers to still download core functions -if [ -z "${lgsmdir}" ]; then +if [ -z "${lgsmdir}" ]||[ -z "${functionsdir}" ]||[ -z "${libdir}" ]; then lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" @@ -265,6 +265,10 @@ functionfile="${FUNCNAME}" fn_fetch_function } +command_dev_detect_glibc.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Fix diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index f7c566d7f..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}" @@ -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}" @@ -156,6 +160,8 @@ case "${getopt}" in 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}" @@ -218,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;; *) @@ -283,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}" @@ -349,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;; *) @@ -417,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}" diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 7f27d886c..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_glibc.sh b/lgsm/functions/fix_glibc.sh index 0a4859fc3..5abe1ea28 100644 --- a/lgsm/functions/fix_glibc.sh +++ b/lgsm/functions/fix_glibc.sh @@ -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/info_distro.sh b/lgsm/functions/info_distro.sh index 85801a70d..4f3012730 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -25,7 +25,11 @@ else distroname="$(uname -s) $(uname -r)" fi -distroversion=$(grep VERSION_ID /etc/os-release | tr -cd '[:digit:]') +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 # e.g: 1.17 diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index f0ba4672e..5aa16cbd7 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -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" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 281ddb87f..90ebb2ff1 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -247,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 @@ -255,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 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/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index b37e4d26e..bf1b88884 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -2,7 +2,7 @@ # LGSM update_minecraft.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Handles updating of minecraft servers. +# Description: Handles updating of Minecraft servers. local commandname="UPDATE" local commandaction="Update" 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 6f126b8a7..7522cd0fe 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -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 e64963b66..d3406022b 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -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 "================================="