Skip to content

[BUG] The scripts using grep to get game server information can garble info when multiple lines match the grep. #3876

@Avanesov79

Description

@Avanesov79

User Story

As a server admin I want the game server gathering scripts to not assume that the target string is only listed once in the config file.

Basic info

Distro: AlmaLinux 8.6 (Sky Tiger)
Game: Ark: Survival Evolved
Command: I have noticed this in details, backup and I believe it is responsible for my discord alert failure as well.
LinuxGSM version: v21.5.1

Further Information

I use the Beacon server manager to setup my Ark configuration files. It prints the config files with additional lines that contains meta data about what fields it manages. When the LinuxGSM scripts gathers info from these files it grabs the additional lines that also contains references to the keys it is looking for and outputs it all together. For example when I run "./arklostisland details" the "Server Name:" section lists:

Server name:         ManagedKeys(SectionSessionSettingsKeys())
Avas Lost Island Ark Server

This is because the "SessionName" string that is grepped is also included in the [Beacon] section so Beacon knows it is a managed key.

To Reproduce

Steps to reproduce the behaviour:

  1. Add additional lines to a config file that is grepped for a specific string and reference that string along with other information.
  2. Run ./serverscript details (or backup, or run a discord test-alert if the key for the server name is referenced...it will not parse the JSON)
  3. check your output

Expected behaviour

The information gathering scripts should be able to distinguish between lines that contain only the needed key=value pair and other lines that may reference the desired key.

I am attaching my ark server config file that contains the added content by Beacon (private info redacted) as well as a file with relevant output from the details command to show what is gathered. The relevant details fields are: Server Name, Server Password and Admin Password.
details_info.txt
GameUserSettings_upload.ini.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions