From 6c6fd3a33c041fb35d24ae7f98f1feeeadf523b1 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 19 Feb 2017 06:49:59 +0100 Subject: [PATCH] Create gamelogdir if variable exists & dir doesn't --- lgsm/functions/check_logs.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh index 5e9da586c..d4fec4b1a 100644 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -7,11 +7,20 @@ local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -# Create directories for the script and console logs -if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then +fn_check_logs(){ fn_print_dots "Checking for log files" sleep 0.5 fn_print_info_nl "Checking for log files: Creating log files" checklogs=1 install_logs.sh +} + +# Create directories for the script and console logs +if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then + fn_check_logs +fi + +# Create gamelogdir if variable exist but dir doesn't exist +if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then + fn_check_logs fi