Shutdown properly instead of restarting server
This commit is contained in:
parent
f376cce807
commit
b7e43cf437
1 changed files with 6 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue