LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

[BUG] Cron emails contain garbage characters

Open jrmain opened this issue 2 years ago • 0 comments

User Story

As a LinuxGSM server operator, I want the garbage characters (apparently spurious ANSI sequences) removed from LinuxGSM Cron emails, so that those emails are easier to read and parse.

Basic info

  • Distro: [Ubuntu 18.04]
  • Game: Unreal Tournament 99, Unreal Tournament 2004, Valheim
  • Command: update-lgsm
  • LinuxGSM version: v21.5.0

Further Information

When some LinuxGSM Cron functions run, they generate email. For example, I receive a daily email for each LGSM server when the scheduled update-lgsm function runs for each server.

These emails contain what appears to be ANSI formatting strings. Here are some highlights from this morning's update email:

[K[ .... ] Updating LinuxGSM vhserver: [K[ .... ] Updating LinuxGSM vhserver: Selecting repo [K[ OK ] Updating LinuxGSM vhserver: Selecting repo: GitHub fetching GitHub linuxgsm.sh...OK [2K checking vhserver...UPDATE fetching GitHub _default.cfg...OK [2K [K[ .... ] Updating LinuxGSM vhserver: Sending Email alert: [redacted] [K[ OK ] Updating LinuxGSM vhserver: Sending Email alert: [redacted] fetching GitHub ubuntu-18.04.csv...OK [2K checking GitHub module alert_email.sh...OK fetching GitHub check_deps.sh...OK [2K checking GitHub module check_executable.sh...OK fetching GitHub core_dl.sh...OK [2K checking GitHub module core_exit.sh...OK fetching GitHub core_functions.sh...OK [2K checking GitHub module core_getopt.sh...OK fetching GitHub fix_steamcmd.sh...OK [2K checking GitHub module fix_vh.sh...UPDATE fetching GitHub fix_vh.sh...OK [2K checking GitHub module info_distro.sh...UPDATE fetching GitHub info_distro.sh...OK [2K checking GitHub module info_game.sh...UPDATE fetching GitHub info_game.sh...OK [2K checking GitHub module info_messages.sh...UPDATE fetching GitHub info_messages.sh...OK [2K checking GitHub module install_complete.sh...OK fetching GitHub install_config.sh...OK [2K checking GitHub module install_header.sh...OK fetching GitHub install_server_files.sh...OK [2K checking GitHub module install_stats.sh...OK [K[ OK ] Updating LinuxGSM vhserver: Updating functions

(Those are all the lines that contain the garbage characters from the email. All the other lines look fine.)

The garbage characters make reading and parsing the email more difficult, and they don't add anything useful, so if they could be removed, that would be great.

Related settings: emailalert="on" ansi="off"

To Reproduce

Steps to reproduce the behaviour:

  1. Configure update-lgsm to run automatically using Cron, send email, and NOT use ANSI.
  2. Examine the resulting email.

Expected behaviour

No garbage characters in the email generated by update-lgsm.

jrmain avatar Jan 01 '22 14:01 jrmain