Prevent log roll error when log had not been created.

This commit is contained in:
Marcus Whybrow 2012-07-20 10:13:31 +01:00
parent 7a8a91992c
commit 54fdd5bb9b

View File

@ -1352,6 +1352,9 @@ server_log_roll() {
# Moves and Gzips the logfile, a big log file slows down the
# server A LOT
# Creates the server log if not already present. Prevents errors.
as_user "${SERVER_USERNAME[$1]}" "touch \"${SERVER_LOG_PATH[$1]}\""
local log_lines="$(cat "${SERVER_LOG_PATH[$1]}" | wc -l )"
if [ "$log_lines" -le '1' ]; then