#
#       HylaFAX-v4.0pl1 postinstall script
#       (c) Matthias Apitz, 01.12.1996
#
#	test for previous installed FlexFAX
#
test -x /usr/bin/clear && /usr/bin/clear
test -x /bin/clear     && /bin/clear

cat <<EOF-EOF-EOF

HylaFAX v4.0pl1 post-install script.

EOF-EOF-EOF

if grep -i flexfax /etc/inetd.conf > /dev/null
then
	cat <<EOF-EOF-EOF
It seems that there is/was a previous installed FlexFAX distribution.
You should remove this distribution / package and this"
entry in /etc/inetd.conf:

EOF-EOF-EOF

  	grep -i flexfax /etc/inetd.conf

/bin/echo ""
/bin/echo -n "Hit ENTER to continue: " ; read x
test -x /usr/bin/clear && /usr/bin/clear
test -x /bin/clear     && /bin/clear
fi
#
#	test for previous installed HylaFAX
#
if grep -i hylafax /etc/inetd.conf > /dev/null
then
	cat <<EOF-EOF-EOF

It seems that there is/was a previous installed HylaFAX distribution.
The new v4.0 HylaFAX distribution was now installed below the directory
/usr/local/lib/HylaFAX-v4.0/ -- please change your PATH settings to this
new distribution and uncomment the following line in /etc/inetd.conf:

EOF-EOF-EOF
	grep -i hylafax /etc/inetd.conf

	cat <<EOF-EOF-EOF

The new HylaFAX-v4.0 daemons faxq(1M), hfaxd(1M) and faxgetty(1M)
should be started from /etc/rc2.d/S99HylaFAX.

EOF-EOF-EOF
  	/bin/echo -n "Hit ENTER to continue: " ; read x
fi
#
#	test SVR4.2 vs. SVR4.0
#
test -x /usr/bin/clear && /usr/bin/clear
test -x /bin/clear     && /bin/clear

cat <<EOF-EOF-EOF

We're now going to test with "uname -a" to deduce which faxgetty(1M)
should be used
EOF-EOF-EOF

sys=`uname -a`
/bin/echo ""
/bin/echo -n "You have a \"$sys\" -- "
case "$sys" in
	*4.2*)	/bin/echo "Please use \"sbin/faxgetty\" " ;;
	*4.1*)	/bin/echo "Please use \"sbin/faxgetty.40\" " ;;
	*4.0*)	/bin/echo "Please use \"sbin/faxgetty.40\" " ;;
	*5.41*)	/bin/echo "Please use \"sbin/faxgetty.40\" " ;;
	*)	/bin/echo "Can't deduce system type SVR4.2 vs. SVR4.0 " ;;
esac
/bin/echo "\nFor more information see the INSTALL guide."
#
#	done.
#
cat <<EOF-EOF-EOF

Please perform the final steps according the INSTALL guide:

- setup your system and modem(s) with faxsetup(1M)
- create and edit the file /etc/rc2.d/S99HylaFAX
- fire up the daemons with "sh /etc/rc2.d/S99HylaFAX start"

EOF-EOF-EOF
/bin/echo -n "Hit ENTER to continue: " ; read x
exit 0
