4th September, 2013

Check status of all your configured Vagrant boxes

Check status of all your configured Vagrant boxes

First we need a script to check the status of any directory passed in as a parameter

$ sudo nano /usr/bin/vagrant-status

Then into this file put:

#!/bin/bash
cd $1

echo --------------------------------------------------
echo Vagrant Box Status for $1

vagrant status

echo --------------------------------------------------
echo

Now make it executable

$ sudo chmod a+x /usr/bin/vagrant-status

Then finally, the following command will check all subdirectories, looking for Vagrant hidden directories and checking the status of each one

$ find . -name ".vagrant" -type d -exec vagrant-status {} \;

This starts in the current working directory. To change to Home use

$ find ~ -name ".vagrant" -type d -exec vagrant-status {} \;

Which I put as an alias in my .bash_rc file

 

Add Comment

The opinions expressed here are my own and not those of my employer.