#!/bin/sh
#
# Copyright 1996, 2002 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident	"@(#)i.renameold	1.4	02/08/09 SMI"
#
TAG=old
CLEANUP_FILE=/tmp/CLEANUP

while read src dest
do
	if [ ! -f $dest ] ; then
		cp $src $dest
	else
		cmp -s $src $dest
		if [ $? != 0 ] ; then
			cp $dest $dest.${TAG}
			cp $src $dest
			echo "EXISTING_FILE_RENAMED: ${dest} ${dest}.${TAG}" \
			>> ${CLEANUP_FILE}
		fi
	fi
done
exit 0
