From 1ba7e7121e8f778d7181eebaed0e0a71143152ff Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 7 Dec 2018 19:28:05 +0000 Subject: [PATCH] refactor(details): change gamedig vars to unset if required --- lgsm/functions/query_gamedig.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 1bdce107a..21e0ed091 100644 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -89,37 +89,37 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; # server name gdname=$(echo "${gamedigraw}" | jq -re '.name') if [ "${gdname}" == "null" ]; then - gdname= + unset gdname fi # numplayers gdplayers=$(echo "${gamedigraw}" | jq -re '.players|length') if [ "${gdplayers}" == "null" ]; then - gdplayers= + unset gdplayers fi # maxplayers gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers|length') if [ "${gdmaxplayers}" == "null" ]; then - maxplayers= + unset maxplayers fi # current map gdmap=$(echo "${gamedigraw}" | jq -re '.map') if [ "${gdmap}" == "null" ]; then - gdmap= + unset gdmap fi # current gamemode gdgamemode=$(echo "${gamedigraw}" | jq -re '.raw.rules.GameMode_s') if [ "${gdgamemode}" == "null" ]; then - gdgamemode= + unset gdgamemode fi # numbots gdbots=$(echo "${gamedigraw}" | jq -re '.raw.numbots') if [ "${gdbots}" == "null" ]; then - gdbots= + unset gdbots fi fi fi \ No newline at end of file