From 934c8ecf332f6f03529d5ba3cadc71d597bfdf6c Mon Sep 17 00:00:00 2001 From: Steven Chamberlain Date: Sun, 3 May 2015 14:30:53 +0100 Subject: g-i: delete tarball if it fails to extract --- bin/g-i-installation.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin/g-i-installation.sh') diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh index e845356a..83ce9ca9 100755 --- a/bin/g-i-installation.sh +++ b/bin/g-i-installation.sh @@ -1275,9 +1275,13 @@ if [ ! -z "$NETBOOT" ] ; then # if there is a netboot installer tarball... # fetch_if_newer "$NETBOOT" "$URL" - # try to extract, otherwise abort sha256sum "$NETBOOT" - tar -zxvf "$NETBOOT" || exit + # try to extract, otherwise clean up and abort + if ! tar -zxvf "$NETBOOT" ; then + echo "tarball seems corrupt; deleting it" + rm -f "$NETBOOT" + exit 1 + fi elif [ ! -z "$IMAGE" ] ; then # # if there is a CD image... -- cgit v1.2.3-54-g00ecf