Browse Source

config and message changes

pull/2911/head
scott 5 years ago
parent
commit
413aff4ed6
  1. 9
      lgsm/functions/info_config.sh
  2. 2
      lgsm/functions/info_messages.sh

9
lgsm/functions/info_config.sh

@ -461,16 +461,13 @@ fn_info_config_mofm(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
serverpassword="${unavailable}"
maxplayers="${zero}"
else
servername=$(grep "Server Name:" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "Server Password:" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
maxplayers=$(grep "MaxPlayers:" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
servername=$(grep "ServerName:" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "ServerPassword:" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
# Not Set
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
fi
}

2
lgsm/functions/info_messages.sh

@ -877,7 +877,7 @@ fn_info_message_mofm(){
{
echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
echo -e "> ServerQuery\tINBOUND\t${port}\tudp"
} | column -s $'\t' -t
}

Loading…
Cancel
Save