From aaff7c9bdb693fff9cd45c98afc8a1f4013ff47d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 2 Sep 2023 01:05:06 +0100 Subject: [PATCH] fix: Steam log symlink points to correct location This commit adds the functionality to create a symbolic link for Steam logs if it is missing. The symlink is created in the specified log directory. --- lgsm/modules/check_logs.sh | 5 +++++ lgsm/modules/install_logs.sh | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/check_logs.sh b/lgsm/modules/check_logs.sh index 2087ac9157..036eea5e44 100644 --- a/lgsm/modules/check_logs.sh +++ b/lgsm/modules/check_logs.sh @@ -24,3 +24,8 @@ fi if [ "${gamelogdir}" ] && [ -d "${gamelogdir}" ] && [ ! -d "${logdir}/server" ]; then fn_check_logs fi + +# Create Steam log symlink if missing +if [ ! -d "${logdir}/steam" ] && [ -n "${appid}" ]; then + fn_check_logs +fi diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh index 31a4085063..cd26addd3c 100644 --- a/lgsm/modules/install_logs.sh +++ b/lgsm/modules/install_logs.sh @@ -86,10 +86,10 @@ if [ "${gamelogdir}" ]; then fi # If server uses SteamCMD create a symbolic link to the Steam logs. -if [ -d "${rootdir}/Steam/logs" ]; then - if [ ! -L "${logdir}/steamcmd" ]; then - echo -en "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..." - if ! ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd"; then +if [ -d "${HOME}/.steam/steam/logs" ]; then + if [ ! -L "${logdir}/steam" ]; then + echo -en "creating symlink to steam log dir: ${logdir}/steam -> ${HOME}/.steam/steam/logs..." + if ! ln -nfs "${HOME}/.steam/steam/logs" "${logdir}/steam"; then fn_print_fail_eol_nl core_exit.sh else