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