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
|
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"
|
||||||
|
|
Loading…
Reference in a new issue