Browse Source

fix(ark): rework parsing of config (#3878)

pull/3886/head
Christian 3 years ago
committed by GitHub
parent
commit
6816d396f8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lgsm/functions/info_game.sh

6
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"}

Loading…
Cancel
Save