1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-02 09:47:00 +03:00

Bug #3063: Remove incomplete files

This commit is contained in:
Jaime Melis 2014-07-24 16:51:27 +02:00
parent b45f29eb0e
commit 29dc081c37

View File

@ -201,6 +201,14 @@ $command | tee >( hasher $HASH_TYPE) | decompress "$decompressor" "$TO"
if [ "$?" != "0" ]; then
echo "Error copying: $command" >&2
# Remove incomplete file
if [ -f "$TO" ]; then
rm "$TO"
elif [ -d "$TO" ]; then
rm -r "$TO"
fi
exit -1
fi