From 6816d396f82b24da5dbfacefbe5b5540dba73497 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 1 Jun 2022 00:13:27 +0200 Subject: [PATCH] fix(ark): rework parsing of config (#3878) --- lgsm/functions/info_game.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 3b6910802..75cef3c69 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -46,9 +46,9 @@ fn_info_game_ark(){ adminpassword="${unavailable}" serverpassword="${unavailable}" else - servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ServerAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) - serverpassword=$( grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(sed -nr 's/^SessionName=(.*)/\1/p' "${servercfgfullpath}") + adminpassword=$(sed -nr 's/^ServerAdminPassword=(.*)/\1/p' "${servercfgfullpath}") + serverpassword=$(sed -nr 's/^ServerPassword=(.*)/\1/p' "${servercfgfullpath}") # Not set servername=${servername:-"NOT SET"}