From 61b5aacc74b50fef4321e3fd32515f983503bd1f Mon Sep 17 00:00:00 2001 From: lrob Date: Wed, 10 Feb 2016 11:37:03 +0100 Subject: [PATCH] Added variables for additional logs --- functions/logs.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/functions/logs.sh b/functions/logs.sh index ecca143c0..317af4255 100644 --- a/functions/logs.sh +++ b/functions/logs.sh @@ -2,17 +2,31 @@ # LGSM logs.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="271215" +lgsm_version="100215" # Description: Acts as a log rotater, removing old logs. local modulename="Log Manager" +# Check if logfile variable and file exist, create logfile if it doesn't exist if [ -n "${consolelog}" ]; then if [ ! -e "${consolelog}" ]; then touch "${consolelog}" fi fi + +# Set source log directory +if [ -z "${systemdir}" && "${engine}" == "source" ]; then + srcdslogdir="${systemdir}/logs" + # Set addons directories + sourcemodlogdir="${systemdir}/addons/sourcemod/logs" + # Set gmod addons directories + if [ "${gamename}" == "Garry's Mod" ]; then + ulxlogdir="${systemdir}/data/ulx_logs" + darkrplogdir="${systemdir}/data/darkrp_logs" + fi +fi + # log manager will active if finds logs older than ${logdays} if [ $(find "${scriptlogdir}"/ -type f -mtime +${logdays}|wc -l) -ne "0" ]; then fn_printdots "Starting"