2006-11-25 01:08:38 -01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd $1
|
|
|
|
|
|
|
|
:> MD5SUMS
|
2008-04-20 14:33:19 +00:00
|
|
|
:> SHA1SUMS
|
2006-11-25 01:08:38 -01:00
|
|
|
|
2006-11-25 02:20:51 -01:00
|
|
|
case $DOJIGDO in
|
2006-11-25 01:08:38 -01:00
|
|
|
0)
|
2006-11-27 16:03:22 -01:00
|
|
|
for file in `find * -name \*.iso`
|
2006-11-25 01:08:38 -01:00
|
|
|
do
|
|
|
|
md5sum $file >> MD5SUMS
|
2008-04-20 14:33:19 +00:00
|
|
|
sha1sum $file >> SHA1SUMS
|
2006-11-25 01:08:38 -01:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
1|2)
|
2008-04-20 14:33:19 +00:00
|
|
|
for file in `find * -name \*.jigdo`
|
2006-11-25 01:08:38 -01:00
|
|
|
do
|
2008-04-20 14:33:19 +00:00
|
|
|
iso=${file%%.jigdo}.iso
|
|
|
|
|
|
|
|
grep -q $iso MD5SUMS
|
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
|
MD5=`zcat -f $file | awk '/Image Hex MD5Sum/ {print $5}'`
|
|
|
|
if [ "$MD5"x != ""x ] ; then
|
|
|
|
echo "$MD5 $iso" >> MD5SUMS
|
|
|
|
else
|
|
|
|
echo "Jigdo file does not contain the Image MD5, calculating by hand"
|
|
|
|
md5sum $iso >> MD5SUMS
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
grep -q $iso SHA1SUMS
|
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
|
SHA1=`zcat -f $file | awk '/Image Hex SHA1Sum/ {print $5}'`
|
|
|
|
if [ "$SHA1"x != ""x ] ; then
|
|
|
|
echo "$SHA1 $iso" >> SHA1SUMS
|
|
|
|
else
|
|
|
|
echo "Jigdo file does not contain the Image SHA1, calculating by hand"
|
|
|
|
sha1sum $iso >> SHA1SUMS
|
|
|
|
fi
|
|
|
|
fi
|
2006-11-25 01:08:38 -01:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
*)
|
2006-11-25 02:20:51 -01:00
|
|
|
echo "DOJIGDO not defined!"
|
2006-11-25 01:08:38 -01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|