Browse Source

Only create dirs if they don't already exist

pull/1323/head
UltimateByte 8 years ago
committed by GitHub
parent
commit
ab8ad9084c
  1. 26
      lgsm/functions/install_logs.sh

26
lgsm/functions/install_logs.sh

@ -15,12 +15,22 @@ if [ "${checklogs}" != "1" ]; then
fi
sleep 1
# Create dir's for the script and console logs
mkdir -v "${rootdir}/log"
mkdir -v "${scriptlogdir}"
touch "${scriptlog}"
if [ ! -d "${rootdir}/log" ]; then
mkdir -v "${rootdir}/log"
fi
if [ ! -d "${scriptlogdir}" ]; then
mkdir -v "${scriptlogdir}"
fi
if [ ! -f "${scriptlog}" ]; then
touch "${scriptlog}"
fi
if [ -n "${consolelogdir}" ]; then
mkdir -v "${consolelogdir}"
touch "${consolelog}"
if [ ! -d "${consolelogdir}" ]; then
mkdir -v "${consolelogdir}"
fi
if [ ! -f "${consolelog}" ]; then
touch "${consolelog}"
fi
fi
# If a server is source or goldsource, TeamSpeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs.
@ -32,7 +42,9 @@ fi
# If a server is unreal2 or unity3d create a dir.
if [ "${engine}" == "unreal2" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Teeworlds" ]||[ "${gamename}" == "seriousengine35" ]; then
mkdir -pv "${gamelogdir}"
if [ ! -d ${gamelogdir}" ]; then
mkdir -pv "${gamelogdir}"
fi
fi
# If server uses SteamCMD create a symbolic link to the Steam logs.
@ -42,4 +54,4 @@ if [ -d "${rootdir}/Steam/logs" ]; then
fi
fi
sleep 1
fn_script_log_info "Logs installed"
fn_script_log_info "Logs installed"

Loading…
Cancel
Save