From 0290525fbb322276a9f1c92572d5b216dc391b22 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Sat, 17 Aug 2013 22:34:10 +0200 Subject: [PATCH] add checksumming script for release checks --- checksums.sh | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) create mode 100755 checksums.sh diff --git a/checksums.sh b/checksums.sh new file mode 100755 index 0000000..ce7a0ac --- /dev/null +++ b/checksums.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Helper Script to check on Archive integrity +# +# Once the distribution is complete this is used with the index file +# to check its integrity and the checksums of all archives. + +if test $# -lt 1 ; then + echo Usage: $0 archive-xmlfile [GPG-homedir] + exit 1 +fi + +if test $# -ge 2 ; then + gpg --batch --homedir $2 --verify $1.asc $1 + echo +fi + +grep ' -f 1 | while read line ; do + for i in $line ; do + echo $i|grep -q ^sha256 && SHA=`echo $i|cut -d \" -f 2` + echo $i|grep -q ^name && NAME=`echo $i|cut -d \" -f 2` + done + SHA2=`sha256sum $NAME|cut -d " " -f 1` + if test $SHA = $SHA2 ; then + echo GOOD $NAME $SHA + else + echo BAD $NAME + echo " file:" $SHA2 + echo " sig:" $SHA + fi +done \ No newline at end of file -- 1.7.2.5