+# Define a unique ID to be able to distinguish for example corei7-64 from qemux86-64
+if [ "${UUID}" = "" ]; then
+ curInstDir=$(ls -d "${installPath}/*" 2> /dev/null)
+ if [ -d "${curInstDir}" ]; then
+ UUID="basename ${curInstDir}"
+ elif [ "$URL" != "" ]; then
+ UUID=$(echo "$URL" | md5sum |cut -d' ' -f1)
+ elif [ "$filename" != "" ]; then
+ UUID=$(echo $(basename $filename) | md5sum |cut -d' ' -f1)
+ else
+ echo "UUID value must be specify using --uuid option."
+ exit 1
+ fi
+fi
+installPath="${installPath}/${UUID}"
+