Skip to content

Commit 93f3b96

Browse files
committed
Add check for successful server startup
The server_start function always assumes successful startup, which is confusing if the server didn't actually start. More work needs to be done to trap and return the error on startup, but for now, this at least lets the admin know the server didn't actually start.
1 parent 3c1e6eb commit 93f3b96

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

init/msm

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,14 +1432,21 @@ server_start() {
14321432
# Wait for the server to fully start
14331433
server_log_dots_for_lines "$1" "$time_now" "${SERVER_CONSOLE_EVENT_OUTPUT_START[$1]}" "${SERVER_CONSOLE_EVENT_TIMEOUT_START[$1]}"
14341434

1435-
if [[ -f "${SERVER_PATH[$1]}"/eula.txt ]]; then
1436-
if ! grep -q -i 'eula=true' "${SERVER_PATH[$1]}"/eula.txt; then
1437-
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)."
1438-
return
1435+
# Ensure the server started
1436+
if server_is_running "$1"; then
1437+
echo " Done."
1438+
else
1439+
if [[ -f "${SERVER_PATH[$1]}"/eula.txt ]]; then
1440+
if ! grep -q -i 'eula=true' "${SERVER_PATH[$1]}"/eula.txt; then
1441+
echo " Failed."
1442+
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)."
1443+
return
1444+
fi
14391445
fi
1440-
fi
14411446

1442-
echo " Done."
1447+
# TODO: trap and return the error to help troubleshoot startup issues
1448+
echo " Failed."
1449+
fi
14431450
fi
14441451
}
14451452

0 commit comments

Comments
 (0)