#! /usr/bin/sh
#
#ident	"@(#)rcpdisk.sh	1.5	04/12/08 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# by Mark F. Logan

if [ $# -ne 1 ]
then
	echo usage: $0 dest-machine
	exit 1
fi

echo You must set up .rhosts on $1 to allow rcp

local=`hostname`

while :
do
	date
	rcp /kernel/genunix $1:/usr/tmp/genunix.$local.$$
	rcp $1:/usr/tmp/genunix.$local.$$ genunix.$$
	if cmp genunix.$$ /kernel/genunix
	then
		rm genunix.$$
		rcp /etc/motd $1:/usr/tmp/genunix.$local.$$
	else
		exit $?
	fi
done

