Skip to content

Instantly share code, notes, and snippets.

@PGBI
Created June 21, 2016 13:49
Show Gist options
  • Save PGBI/9dfd2cad27fca3b7b5b750d4a9ead522 to your computer and use it in GitHub Desktop.
Save PGBI/9dfd2cad27fca3b7b5b750d4a9ead522 to your computer and use it in GitHub Desktop.
# For macOS users
# Piece of code to be included in your ~/.profile file.
# Typing `vagrant halt all` in your terminal will then halt all the running vagrant VMs.
vagrant() {
if [[ $@ == "halt all" ]]; then
command vagrant global-status | grep running | colrm 8 | xargs -L 1 -t vagrant halt
else
command vagrant "$@"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment