aboutsummaryrefslogtreecommitdiff
path: root/debian-dl
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-02-13 13:32:03 -0200
committerSilvio Rhatto <rhatto@riseup.net>2014-02-13 13:32:03 -0200
commitffabc1ca36a56dd5f031969efa773c94aded9187 (patch)
tree394ccbcb07eb5f7d0c909af3889dc545aa59f0ba /debian-dl
parent6c547ae0539327c683a9c2ce4e478dc966506dcc (diff)
downloadscripts-ffabc1ca36a56dd5f031969efa773c94aded9187.tar.gz
scripts-ffabc1ca36a56dd5f031969efa773c94aded9187.tar.bz2
Integrity check at debian-dl
Diffstat (limited to 'debian-dl')
-rwxr-xr-xdebian-dl15
1 files changed, 13 insertions, 2 deletions
diff --git a/debian-dl b/debian-dl
index 2566b4f..ea25be2 100755
--- 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