Created
November 23, 2016 06:02
-
-
Save perillamint/bd21e14c243035cbaab3dbd87733ab11 to your computer and use it in GitHub Desktop.
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 | |
ZIPFILE=$1 | |
if [ ! -f "${ZIPFILE}" ] | |
then | |
exit 1 | |
fi | |
if [ -d qcow ] | |
then | |
rm -rf qcow | |
fi | |
mkdir qcow | |
cd qcow | |
unzip "../${ZIPFILE}" | |
OVAFILE=$(ls | grep ova) | |
tar xf "${OVAFILE}" | |
OVFFILE=$(ls | grep ovf) | |
rm -f "${OVFFILE}" | |
rm -f "${OVAFILE}" | |
VMDKFILE=$(ls | grep vmdk) | |
qemu-img convert -f vmdk -O qcow2 "${VMDKFILE}" "${VMDKFILE%%.*}.qcow2" | |
rm -f "${VMDKFILE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment