Shutdown properly instead of restarting server

This commit is contained in:
JeremyStar™ 2024-01-27 18:07:12 +01:00
parent f376cce807
commit b7e43cf437

View file

@ -25,7 +25,8 @@ function kill_server() {
if [ -z "${CHILDPID}" ]; then
internal_error "\$CHILDPID is unset"
fi
kill -SIGINT "${CHILDPID}"
export "SHUTDOWN=true"
kill -INT "${CHILDPID}"
}
# Print the MCSD banner
@ -189,6 +190,10 @@ function main() {
# Run server once
run
# Restart server if enabled
if [ "${SHUTDOWN}" == "true" ]; then
echo ":: Ending execution"
exit 0
fi
case "${MCSD_AUTO_RESTART}" in
"true")
echo ":: Restarting server"