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:
parent
fef564a570
commit
078d6e126e
10
vm.zsh
10
vm.zsh
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue