Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for successful server startup #428

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions init/msm
Original file line number Diff line number Diff line change
Expand Up @@ -1432,14 +1432,21 @@ server_start() {
# Wait for the server to fully start
server_log_dots_for_lines "$1" "$time_now" "${SERVER_CONSOLE_EVENT_OUTPUT_START[$1]}" "${SERVER_CONSOLE_EVENT_TIMEOUT_START[$1]}"

if [[ -f "${SERVER_PATH[$1]}"/eula.txt ]]; then
if ! grep -q -i 'eula=true' "${SERVER_PATH[$1]}"/eula.txt; then
echo " Could not start the server as you first need to agree to an EULA. See eula.txt for more info (${SERVER_PATH[$1]}/eula.txt)."
return
# Ensure the server started
if server_is_running "$1"; then
echo " Done."
else
if [[ -f "${SERVER_PATH[$1]}"/eula.txt ]]; then
if ! grep -q -i 'eula=true' "${SERVER_PATH[$1]}"/eula.txt; then
echo " Failed."
echo "Could not start the server as you first need to agree to an EULA. See eula.txt for more info (${SERVER_PATH[$1]}/eula.txt)."
return
fi
fi
fi

echo " Done."
# TODO: trap and return the error to help troubleshoot startup issues
echo " Failed."
fi
fi
}

Expand Down