vm.zsh: Various Updates

* Improve the exit trap to make sure child processes are stopped
* wait $(jobs -pr) is the same thing as wait with no options

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2023-07-19 13:17:40 -04:00
parent fef564a570
commit 078d6e126e
1 changed files with 3 additions and 7 deletions

10
vm.zsh
View File

@ -33,12 +33,8 @@ function vm_reboot() {
vm_boot $1 vm_boot $1
} }
TRAPEXIT() { TRAPINT() {
if [[ ! -z "$(jobs -pr)" ]]; then kill -9 0
for job in ($(jobs -pr)); do
kill -9 $job
done
fi
} }
for vm in "${@:2}"; do for vm in "${@:2}"; do
@ -59,4 +55,4 @@ for vm in "${@:2}"; do
esac esac
done done
wait $(jobs -pr) wait