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. 12
      lgsm/functions/install_logs.sh

12
lgsm/functions/install_logs.sh

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

Loading…
Cancel
Save