#!      /bin/csh -f
#
# Copyright 1993, 1994, 1995 by the Regents of the University of California.
# see the file "Copyright" in the distribution for conditions of use.
#
#
#       set up to keep mail and send "vacation" message
#
#	get temp file for new .forward
#
if( ! -e ~/.vacation.msg ) then
	echo 'First you need to create an automatic reply message.'
	exit 1
endif
#
set logon = $USER
if( ! -e ~${logon} ) then
	echo "*** can't figure out information - no changes made ***"
	exit 1
endif

#	set up .forward in temp
set new = `mktemp -c -pfrwrd`

cat << EOT >! $new
\\$logon,
"|/usr/ccs/bin/vacation $logon"
EOT
#
#	initialize vacation
vacation -i

#	install .forward
install_forward $new
if ( $status ) then
	echo No changes made.
else
	echo Mail will be saved and vacation message will be sent.
endif
/bin/rm -f $new
exit 0
