Trap SIGINT for clean ^C shutdown

This commit is contained in:
Michael Vines 2018-07-30 17:09:05 -07:00 committed by Grimes
parent e985c2e7d5
commit 5d936e5c8a
1 changed files with 4 additions and 1 deletions

View File

@ -22,6 +22,7 @@ for cmd in $backgroundCommands; do
done
shutdown() {
exitcode=$?
set +e
echo --- Shutdown
for pid in "${pids[@]}"; do
@ -37,9 +38,11 @@ shutdown() {
upload_ci_artifact "$logfile"
tail "$logfile"
done
exit $exitcode
}
trap shutdown EXIT
trap shutdown EXIT INT
set -e