#
#	HylaFAX-v4.0pl1 preinstall script
#	(c) Matthias Apitz, 01.12.1996
#
#	backup files which would be overwritten during installation
#	
#
ROOT=/usr/local/lib/HylaFAX-v4.0
#
test -x /usr/bin/clear && /usr/bin/clear
test -x /bin/clear     && /bin/clear
#
cat <<EOF-EOF-EOF

HylaFAX v4.0pl1 pre-install script.

Checking to see if there is/was a previous installed HylaFAX
distribution in which case we're backing up some files you may
later want to re-use...."

EOF-EOF-EOF

if [ ! -d $ROOT ]
then
	echo "....nothing to do, let's install the new version."
	echo ""
	exit 0
fi

cd	$ROOT
for file in			\
     spool/etc/hosts		\
     spool/etc/xferlog		\
     spool/etc/pagermap		\
     spool/etc/FaxDispatch	\
     spool/etc/config.*		\
     lib/*.ps
do
	if [ -f $file ]
	then
		# NB: don't copy saved files again
		echo $file | grep "saved" >/dev/null && continue;
		echo .... saving $file as $file.saved
		cp    $file $file.saved
		chmod 0400  $file.saved
	fi
done
#
#	done.
#
cat <<EOF-EOF-EOF

HylaFAX v4.0pl1 pre-install script done.

EOF-EOF-EOF
exit 0
