From 413aff4ed602b284e42b852ab90922f045ef11aa Mon Sep 17 00:00:00 2001 From: scott Date: Sat, 30 May 2020 04:21:59 +0900 Subject: [PATCH] config and message changes --- lgsm/functions/info_config.sh | 9 +++------ lgsm/functions/info_messages.sh | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 79179f4ea..d0c5e9951 100644 --- a/lgsm/functions/info_config.sh +++ b/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 } diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 8a0d70308..5c7fda1ae 100644 --- a/lgsm/functions/info_messages.sh +++ b/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 }