2006-11-25 01:08:38 -01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd $1
|
|
|
|
|
|
|
|
:> MD5SUMS
|
|
|
|
|
2006-11-25 02:20:51 -01:00
|
|
|
case $DOJIGDO in
|
2006-11-25 01:08:38 -01:00
|
|
|
0)
|
|
|
|
for file in `find * -name \*.raw`
|
|
|
|
do
|
|
|
|
md5sum $file >> MD5SUMS
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
1|2)
|
|
|
|
for file in `find * -name \*.template`
|
|
|
|
do
|
|
|
|
if [ "`tail --bytes=33 "$file" | head --bytes=1 | od -tx1 -An | sed -e 's/ //g'`" != 05 ]; then
|
|
|
|
echo "Possibly invalid template $file"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
grep -q " ${file%%.template}.raw"'$$' MD5SUMS \
|
|
|
|
|| echo "`tail --bytes=26 "$file" | \
|
|
|
|
head --bytes=16 | \
|
|
|
|
od -tx1 -An | \
|
|
|
|
sed -e 's/ //g'` ${file%%.template}.raw" >> MD5SUMS
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
*)
|
2006-11-25 02:20:51 -01:00
|
|
|
echo "DOJIGDO not defined!"
|
2006-11-25 01:08:38 -01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|