File: md5itall

package info (click to toggle)
pam 1.3.1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 13,084 kB
  • sloc: ansic: 31,022; xml: 21,835; sh: 12,645; makefile: 1,606; perl: 904; yacc: 408; lex: 72; sed: 16
file content (43 lines) | stat: -rwxr-xr-x 993 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
#
# $Id$
#
# Created by Andrew G. Morgan (morgan@parc.power.net)
#

MD5SUM=md5sum
CHKFILE1=./.md5sum
CHKFILE2=./.md5sum-new

which $MD5SUM > /dev/null
result=$?

if [ -x "$MD5SUM" ] || [ $result -eq 0 ]; then
	rm -f $CHKFILE2
	echo -n "computing md5 checksums."
	for x in `cat ../.filelist` ; do
		(cd ../.. ; $MD5SUM $x) >> $CHKFILE2
		echo -n "."
	done
	echo
	if [ -f "$CHKFILE1" ]; then
		echo "\
---> Note, since the last \`make check', the following file(s) have changed:
==========================================================================="
		diff $CHKFILE1 $CHKFILE2
		if [ $? -eq 0 ]; then
			echo "\
--------------------------- Nothing has changed ---------------------------"
		fi
		echo "\
==========================================================================="
	fi
	rm -f "$CHKFILE1"
	mv "$CHKFILE2" "$CHKFILE1"
	chmod 400 "$CHKFILE1"
else
	echo "\
Please install \`$MD5SUM'.
[It is used to check the integrity of this distribution]
---> no check done."
fi