Created
February 2, 2017 07:29
-
-
Save mohclips/28dfc70dea4753c7238cf8c0b77290ce to your computer and use it in GitHub Desktop.
rebuilds a named vagrant vm
This file contains hidden or 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
#!/bin/bash | |
V=$1 | |
containers=$(cat ~/.vagrant.d/data/machine-index/index | jq '.machines[] | {name} | to_entries[] | .value') | |
if [ $(echo $containers | grep -c \"$V\") -ne 1 ] ; then | |
echo "Can't find $V in container list" | |
echo $containers | |
exit 2 | |
fi | |
echo "**Rebuilding... $V" | |
echo "*Halt" | |
vagrant halt -f $V | |
echo "*Destroy" | |
vagrant destroy -f $V | |
echo "*Up" | |
vagrant up $V |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment