From 65d539595887b248ae785fd7c2bec62c28024421 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sat, 1 Jan 2022 04:25:07 -0600 Subject: [PATCH] Check for the log directory --- Scripts/7D2D-Manage.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/7D2D-Manage.bash b/Scripts/7D2D-Manage.bash index 258bca8..b9bb7d3 100644 --- a/Scripts/7D2D-Manage.bash +++ b/Scripts/7D2D-Manage.bash @@ -649,6 +649,11 @@ view() { server_directory="${BASE_DIR}/${server_name}" server_log_dir="${server_directory}/7DaysToDieServer_Data" + if [[ ! -d "${server_log_dir}" ]]; then + log "error" "Could not find a log directory for $(important "${server_name}") at $(important "${server_name}"), does the server exist?" + return 1 + fi + tail -f "$(ls -t "${server_log_dir}"/output_log* | head -1)" }