Skip to content

Instantly share code, notes, and snippets.

@sebastiz
Forked from jonahbron/fix_vagrant_boxes.sh
Last active August 29, 2015 14:21
Show Gist options
  • Save sebastiz/2b4d0de324395fc3d68e to your computer and use it in GitHub Desktop.
Save sebastiz/2b4d0de324395fc3d68e to your computer and use it in GitHub Desktop.
#!/bin/bash
provider=virtualbox
# Loop over boxes
for box in ~/.vagrant.d/boxes/*; do
# Create provider directory to contain files
mkdir $box/$provider/
# Move all provider files into provider directory
mv $box/box-*.vmdk $box/box.ovf $box/Vagrantfile $box/$provider/
# Create provider metadata file
echo "{\"provider\":\"$provider\"}" > $box/$provider/metadata.json
echo Fixed box $(basename $box)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment