Permalink
Browse files

improve build.sh to check md5hash of iso

  • Loading branch information...
1 parent d74427f commit 7f50a06e2e7f939f7468e719f637291e735c608f @mostlygeek mostlygeek committed Apr 26, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 build.sh
View
11 build.sh
@@ -31,9 +31,16 @@ INITRD_FILENAME="${FOLDER_ISO}/initrd.gz"
ISO_GUESTADDITIONS="/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso"
# download the installation disk if you haven't already or it is corrupted somehow
-if [ ! -e "${ISO_FILENAME}" ] || [ ! `md5 "${ISO_FILENAME}"` -eq ${ISO_MD5}]
+if [ ! -e "${ISO_FILENAME}" ]
then
- curl -v --output "${ISO_FILENAME}" -L "${ISO_URL}"
+ curl --output "${ISO_FILENAME}" -L "${ISO_URL}"
+else
+ # make sure download is right...
+ ISO_HASH=`md5 -q "${ISO_FILENAME}"`
+ if [ "${ISO_MD5}" != "${ISO_HASH}" ]; then
+ echo "MD5 does not match. Got ${ISO_HASH} instead of ${ISO_MD5}"
+ exit 1
+ fi
fi
# customize it

0 comments on commit 7f50a06

Please sign in to comment.