From e8621eaed6d7b7f38fa3911858a4c28a0e4dcc18 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 20 Aug 2021 13:56:33 +0100 Subject: [PATCH] updated source filters --- lgsm/functions/info_game.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index eb6ce56ae..66e87daea 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -14,7 +14,6 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # grep -v "foo" filter out lines that contain foo # cut -f1 -d "/" remove everything after / - fn_info_game_ac(){ if [ ! -f "${servercfgfullpath}" ]; then httpport="${zero}" @@ -103,7 +102,6 @@ fn_info_game_av() { rconenabled="${unavailable}" queryport="${unavailable}" else - maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') @@ -117,7 +115,6 @@ fn_info_game_av() { rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') if [ -n "${rconpassword}" ]; then rconenabled="true" - fi # Not set @@ -1497,9 +1494,9 @@ fn_info_game_source(){ serverpassword="${unavailable}" rconpassword="${unavailable}" else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "hostname" "${servercfgfullpath}" | tr -d '\";,:' | sed -e '/^#/d' -e 's/hostname//g' -e 's/^[ \t]*//g' -e 's/[ \t]*$//g') + serverpassword=$(grep "sv_password" "${servercfgfullpath}" | tr -d '\";,:' | sed -e '/^#/d' -e 's/hostname//g' -e 's/^[ \t]*//g' -e 's/[ \t]*$//g') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | tr -d '\";,:' | sed -e '/^#/d' -e 's/hostname//g' -e 's/^[ \t]*//g' -e 's/[ \t]*$//g') # Not Set servername=${servername:-"NOT SET"}