:
#	@(#) bcheckrc.sh 23.8 91/09/02 
#
#	Copyright (C) 1988-1991 The Santa Cruz Operation, Inc.
#		All Rights Reserved.
#	The information in this file is provided for the exclusive use of
#	the licensees of The Santa Cruz Operation, Inc.  Such users have the
#	right to use, modify, and incorporate this code into other products
#	for purposes authorized by the license agreement provided they include
#	this notice and the associated copyright notice with any such product.
#	The information in this file is provided "AS IS" without warranty.
#
#	Copyright (c) 1984, 1986, 1987, 1988 AT&T

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

# ***** This file has those commands necessary to check the file
# system, date, and anything else that should be done before mounting
# the file systems.

#!	chmod +x ${file}



[ -x /instscript ] && exec /instscript		# for installation only

if [ "$1" != "-a" ]
then
	[ -x /etc/dumpsave ]  && /etc/dumpsave
fi

rootfs=/dev/root
/etc/fsstat ${rootfs}  >/dev/null 2>&1
if [ $? -ne 0 ]
then
	dofsck=yes
	fsckflags="-s -D -b"
	autoflag=-a				# -a flag to fsck for autoboot
	if [ "$1" != "-a" ]
	then
		autoflag=
		echo "
fsstat: root file system needs checking.
OK to check the root file system (${rootfs})? (y/n) \c"
		while 
			read reply
			[ "$reply" ]
		do
			case $reply in
			n)	dofsck=
				break
				;;
			y)	break
			;;
		*)	echo "\n? (y/n) \c"
			;;
			esac
		done
	fi
	[ "$dofsck" ] && 
	/bin/su root -c "/etc/fsck -s -D -b ${autoflag} ${rootfs}"
fi

[ -f /instscript ] && rm -f /etc/inittab.inst /instscript # post-Upgrade cleanup



trap "" 2


# put root into mount table
/bin/su root -c "/etc/devnm /" | sed -n '/^\/./p' | grep -v swap | /etc/setmnt

