Skip to content
Permalink
Browse files

fix(mcserver): correct wrong query port fetched from config (#2355)

Co-authored-by: DUDU54 <14166148+DUDU54@users.noreply.github.com>
  • Loading branch information...
DUDU54 authored and dgibbs64 committed May 12, 2019
1 parent efba854 commit 229fe133f6cb60d49c8a37819c4cb771abd2b03a
Showing with 5 additions and 2 deletions.
  1. +5 −2 lgsm/functions/info_config.sh
@@ -338,7 +338,10 @@ fn_info_config_minecraft(){
rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
queryport="${port}"
queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
if [ -z "${queryport}" ]; then
queryport=${port}
fi
queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
@@ -353,7 +356,7 @@ fn_info_config_minecraft(){
rconport=${rconport:-"NOT SET"}
maxplayers=${maxplayers:-"NOT SET"}
port=${port:-"NOT SET"}
queryport="${queryport:-"NOT SET"}"
queryport=${queryport:-"NOT SET"}
queryenabled="${queryenabled:-"NOT SET"}"
gamemode=${gamemode:-"NOT SET"}
gameworld=${gameworld:-"NOT SET"}

0 comments on commit 229fe13

Please sign in to comment.
You can’t perform that action at this time.