From aae6c321cc5bd296897f900fa626252507cfaf25 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 15 May 2017 21:21:28 +0100 Subject: [PATCH] new solution to prevent symlink from being created when not required If the gamelogdir is within the logdir then no symlink is created. --- lgsm/functions/install_logs.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index 12d7002c4..054d19445 100644 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -30,9 +30,12 @@ if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then mkdir -pv "${gamelogdir}" fi -# Symlink gamelogdir to lgsm logs if variable exists +# Symlink to gamelogdir +# unless gamelogdir is within logdir +# e.g serverfiles/log is not within log/: symlink created +# log/server is in log/: symlink not created if [ -n "${gamelogdir}" ]; then - if [ ! -h "${logdir}/server" ]; then + if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ];then ln -nfsv "${gamelogdir}" "${logdir}/server" fi fi