Skip to content

Instantly share code, notes, and snippets.

@arashpath
Last active October 12, 2018 08:23
Show Gist options
  • Save arashpath/68c32336599c477084f100030284c846 to your computer and use it in GitHub Desktop.
Save arashpath/68c32336599c477084f100030284c846 to your computer and use it in GitHub Desktop.
Update All vagrant boxes
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