github.com/chasestarr/deis@v1.13.5-0.20170519182049-1d9e59fbdbfc/tests/bin/destroy-all-vagrants.sh (about)

     1  #!/bin/sh
     2  #
     3  # WARNING: Don't run this script unless you understand that it will destroy all Deis vagrant VMs.
     4  #
     5  # Tells vagrant to destroy all VMs with "deis" in the name.
     6  
     7  VMS=$(vagrant global-status | grep deis | awk '{ print $5 }')
     8  for dir in $VMS; do
     9      cd $dir && vagrant destroy --force
    10  done
    11  
    12  # optional commands to remove all VirtualBox vms, since sometimes they are orphaned
    13  #VBoxManage list vms | sed -n -e 's/^.* {\(.*\)}/\1/p' | xargs -L1 -I {} VBoxManage unregistervm {} --delete
    14  #rm -rf $HOME/VirtualBox\ VMs/deis*