diff --git a/script/server b/script/server index 8e1b5b00..cd9fb452 100755 --- a/script/server +++ b/script/server @@ -1,5 +1,13 @@ #!/bin/bash +reap() { + kill -TERM $child + sleep 0.1 + exit +} + +trap reap TERM INT + # If a command fails, exit the script set -e @@ -7,4 +15,7 @@ set -e cd "$(dirname "${0}")/.." # Launch the app -pipenv run python app.py ${@} +pipenv run python app.py ${@} & +child=$! + +wait $child