- if [ -f nubigate-unreleased.img ]; then
- rm -f nubigate-unreleased.vdi
- VBoxManage convertfromraw -format VDI nubigate-unreleased.img "$vdi"
+ if [ -f $img ]; then
+ mustconvert=1
+ if [ -f $vdi ]; then
+ stampvdi=`stat --format=%Y $vdi`
+ stampimg=`stat --format=%Y $img`
+ if [ $stampimg -lt $stampvdi ]; then
+ mustconvert=0
+ fi
+ fi
+ if [ $mustconvert -eq 1 ]; then
+ rm -f nubigate-unreleased.vdi
+ VBoxManage convertfromraw -format VDI "$img" "$vdi"
+ fi