#! /bin/sh

#	Copyright (c) 1989 Frame Technology Corporation

admdir=$FMHOME/.readtape
optionfile=$admdir/options

< $optionfile (
while read option
do
	echo checking $option:

	sumfile=$admdir/$option.sum
	< $sumfile (
	#file names can contain spaces, but not tabs
	IFS='	'
	while
		read file sum link
	do
		if [ -h "$file" ]; then
			if [ "$sum" = "->" ]; then
				newlink=`find "$file" -ls | awk '{ print $13 }' -`
				if [ "$link" != "$newlink" ]; then
					echo "$file is a sym link to a new place"
				fi
			else
				echo "$file was a file, now is a sym link"
			fi
		elif [ -f "$file" ]; then
			newsum=`sum "$file"`
			if [ "$sum" != "$newsum" ]; then
				echo "$file has changed"
			fi
		else
			echo "$file missing"
		fi
	done
	)
done
)
echo "Done."
