Commit 56febb13 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

added a simple tool (quick hack) to check checksums

This is a legacy commit from before 2015-05-18.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 5125
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 0491832c
#!/bin/sh
# this is <csback_cscheck.sh>
# ----------------------------------------------------------------------------
# $Id$
#
# Copyright (c) 2013 by Thomas Forbriger (BFO Schiltach)
#
# passive check of csback checksums
#
# useful for checking external read-only copies of csback controlled data
# structures
#
# REVISIONS and CHANGES
# 09/04/2013 V1.0 Thomas Forbriger
#
# ============================================================================
#
SHABIN=/usr/bin/sha512sum
TMPDIR=$HOME/tmp/$0.$$
if test $# -lt 1
then
echo $0 takes a path name as a single argument
echo the path must point to the root of csback controlled data structure
exit 2
fi
DATADIR=$1
LOGLIST=
HERE=$(pwd)
mkdir -p $TMPDIR
for FILE in $(find $DATADIR -name checksumfile.cs)
do
echo check $FILE
NLINES=$(wc -l $FILE | cut -f 1 -d ' ')
if test $NLINES -gt 0
then
echo " check $NLINES entries"
cd $(dirname $FILE)
LOGFILE=$TMPDIR/$(echo $FILE | tr '/' '_')
cat $(basename $FILE) | tr -s ' ' | cut -f 1,2 -d ' ' \
| sed -e 's/ / /' | $SHABIN -c > $LOGFILE
LOGLIST+=" "$LOGFILE
else
echo " checksum file is empty"
fi
cd $HERE
done
echo "deviant results:"
egrep -v 'OK$' $LOGLIST
echo "number of checked entries:" $(cat $LOGLIST | wc -l)
echo results are archived in $TMPDIR
# ----- END OF csback_cscheck.sh -----
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment