From 7d2b3bdbbf81c55e173e7b93c9a29f115c811f05 Mon Sep 17 00:00:00 2001 From: hennr Date: Thu, 16 Jun 2011 04:54:38 -0700 Subject: [PATCH] Fix for issue #8 in the issue tracker. The script ignore if the first md5sum failed, both are now checked and the script will exit properly if one of the check does not succeed. --- config/release/create_installstick | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) mode change 100755 => 100644 config/release/create_installstick diff --git a/config/release/create_installstick b/config/release/create_installstick old mode 100755 new mode 100644 index f82a792952..73634bec48 --- a/config/release/create_installstick +++ b/config/release/create_installstick @@ -56,14 +56,9 @@ echo "# Please read the instructions and use very carefully.. #" echo "# #" echo "#########################################################" -# check MD5 sums - echo "checking MD5 sum..." - md5sum -c target/KERNEL.md5 - MD5_ERROR="$?" - md5sum -c target/SYSTEM.md5 - MD5_ERROR="$?" - -if [ "$MD5_ERROR" = "1" ]; then +md5sumFailed() +{ + clear echo "#########################################################" echo "# #" echo "# OpenELEC.tv failed md5 check - Installation will quit #" @@ -73,7 +68,19 @@ if [ "$MD5_ERROR" = "1" ]; then echo "# #" echo "#########################################################" exit 1 -fi +} + + +# check MD5 sums + echo "checking MD5 sum..." + md5sum -c target/KERNEL.md5 + if [ "$?" = "1" ]; then + md5sumFailed + fi + md5sum -c target/SYSTEM.md5 + if [ "$?" = "1" ]; then + md5sumFailed + fi # (TODO) umount anything umount "$PART"