cd /
echo ""
echo "This script will remove all traces of APX5.0 from your system."
echo "It will not, however, rebuild your kernel.  That is left up to"
echo "you.  You can always 'mv /unix.preapx /unix' to restore your"
echo "system to the way it was PRIOR to loading APX5.0."
echo ""
echo -n "Do you really want to run this script? "
read a
case "$a" in
yes|y)	;;
*)	echo "** UNINSTALLATION ABORTED -- NOTHING REMOVED **"
	exit 0
	;;
esac
echo ""
echo -n "Do you also want the /usr/apx5 directory tree removed? "
read a
echo "Removing kernel's notion of i860 (APX)..."
/bin/rm -f /etc/rc0.d/K90i860
/etc/conf/bin/idinstall -d i860
if test -s /usr/apx5/etc/fp.old
then
	echo "Restoring old floating point system device entry..."
	cat /usr/apx5/etc/fp.old > /etc/conf/sdevice.d/fp
fi
echo "Removing /dev apx entries..."
/bin/rm -f /dev/i860boot /dev/i860comm
case "$a" in
y|yes)	echo "Removing /usr/apx5 tree..."
	/bin/rm -rf /usr/apx5
	;;
esac
echo ""
echo "APX5.0 is now removed from your system; you should probably generate"
echo "a new kernel as soon as possible."
exit 0
