first commit of deploy.sh for compass
[genesis.git] / compass / deploy / func.sh
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"
8             exit 1
9         fi
10     done
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"
17             exit 1
18         fi
19     done
20 }