Created
August 29, 2013 21:54
-
-
Save geetarista/6383920 to your computer and use it in GitHub Desktop.
Global status for all Vagrant boxes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "Searching for Vagrant boxes..." | |
for file in $(find / -type f -name Vagrantfile 2>/dev/null); do | |
dir=$(dirname $file) | |
echo "Status for ${dir}:" | |
pushd $dir > /dev/null | |
out="$(vagrant status)" | |
popd > /dev/null | |
out="${out/Current machine states\:/}" | |
out="${out/The environment has not yet been created. Run \`vagrant up\` to/}" | |
out="${out/create the environment. If a machine is not created, only the/}" | |
out="${out/default provider will be shown. So if a provider is not listed,/}" | |
out="${out/then the machine is not created for that environment./}" | |
out="${out/The environment has not yet been created. Run \`vagrant up\` to create the environment. If a machine is not created, only the default provider will be shown. So if a provider is not listed, then the machine is not created for that environment./}" | |
out="${out/The VM is powered off. To restart the VM, run \`vagrant up\`/}" | |
echo " " $out | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment