Skip to content

Instantly share code, notes, and snippets.

@shkm
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shkm/7b36f8abba5e612b414d to your computer and use it in GitHub Desktop.
Save shkm/7b36f8abba5e612b414d to your computer and use it in GitHub Desktop.
Suspend or halt all running Vagrant boxes.
# Suspend
vsall() {
vagrant global-status --prune | grep running | awk '{system("vagrant suspend "$1)}'
}
# Halt
vhall() {
vagrant global-status --prune | grep running | awk '{system("vagrant halt "$1)}'
}
@shkm
Copy link
Author

shkm commented Jul 26, 2015

Won't work too well if a box has "running" in the name ;-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment