Browse Source

updated source filters

pull/3428/head
Daniel Gibbs 4 years ago
parent
commit
e8621eaed6
  1. 9
      lgsm/functions/info_game.sh

9
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 # grep -v "foo" filter out lines that contain foo
# cut -f1 -d "/" remove everything after / # cut -f1 -d "/" remove everything after /
fn_info_game_ac(){ fn_info_game_ac(){
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
httpport="${zero}" httpport="${zero}"
@ -103,7 +102,6 @@ fn_info_game_av() {
rconenabled="${unavailable}" rconenabled="${unavailable}"
queryport="${unavailable}" queryport="${unavailable}"
else else
maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//')
servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//')
serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//')
@ -117,7 +115,6 @@ fn_info_game_av() {
rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//')
if [ -n "${rconpassword}" ]; then if [ -n "${rconpassword}" ]; then
rconenabled="true" rconenabled="true"
fi fi
# Not set # Not set
@ -1497,9 +1494,9 @@ fn_info_game_source(){
serverpassword="${unavailable}" serverpassword="${unavailable}"
rconpassword="${unavailable}" rconpassword="${unavailable}"
else 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]*$//') 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}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') 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}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | tr -d '\";,:' | sed -e '/^#/d' -e 's/hostname//g' -e 's/^[ \t]*//g' -e 's/[ \t]*$//g')
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}

Loading…
Cancel
Save