Last active
October 12, 2018 08:23
-
-
Save arashpath/68c32336599c477084f100030284c846 to your computer and use it in GitHub Desktop.
Update 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
cd /tmp | |
echo "Checking for Outdated Boxes" | |
vagrant box outdated --global | awk '/outdated/{print $2}' > /tmp/outdated_boxes | |
sleep 2 | |
cat /tmp/outdated_boxes | |
sleep 1 | |
for box in $(cat outdated_boxes) | |
do | |
echo "Updating : $box " | |
echo "vagrant init $box" | sh | |
vagrant box update | |
rm -f Vagrantfile | |
done | |
vagrant box prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment