1 function tear_down_machines() {
2 virtmachines=$(virsh list --name |grep pxe)
3 for virtmachine in $virtmachines; do
4 echo "destroy $virtmachine"
5 virsh destroy $virtmachine
6 if [[ "$?" != "0" ]]; then
7 echo "destroy instance $virtmachine failed"
11 virtmachines=$(virsh list --all --name |grep pxe)
12 for virtmachine in $virtmachines; do
13 echo "undefine $virtmachine"
14 virsh undefine $virtmachine
15 if [[ "$?" != "0" ]]; then
16 echo "undefine instance $virtmachine failed"