]> gitweb.fluxo.info Git - scripts.git/commitdiff
Integrity check at debian-dl
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 13 Feb 2014 15:32:03 +0000 (13:32 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 13 Feb 2014 15:32:03 +0000 (13:32 -0200)
debian-dl

index 2566b4faf353c2877e3c61c8691c2e4305dbe885..ea25be2bd355cba39ee21f69099924219d3503d3 100755 (executable)
--- a/debian-dl
+++ b/debian-dl
@@ -11,6 +11,7 @@ BASENAME="`basename $0`"
 URL="$1"
 BASE="`dirname $URL`"
 RATE="$2"
+FILENAME="`basename $URL`"
 
 # Syntax
 if [ -z "$1" ]; then
@@ -32,5 +33,15 @@ fi
 # Get the image
 wget -c $LIMIT $URL
 
-# Teardown
-echo "Please check `basename $URL` integrity!"
+# Check hashes
+for hash in $HASHES; do
+  echo "Checking $FILENAME against $hash file..."
+  check="`echo $hash | tr '[:upper:]' '[:lower:]' | sed -e 's/s$//'`sum"
+  grep -e "$FILENAME$" $hash | $check -c
+done
+
+# Check hash integrity
+for hash in $HASHES; do
+  echo "Checking $hash.sig..."
+  gpg --verify $hash.sig
+done