#! /bin/sh
#
# |-----------------------------------------------------------|
# | Copyright (c) 1991, 1990 MIPS Computer Systems, Inc.      |
# | All Rights Reserved                                       |
# |-----------------------------------------------------------|
# |          Restricted Rights Legend                         |
# | Use, duplication, or disclosure by the Government is      |
# | subject to restrictions as set forth in                   |
# | subparagraph (c)(1)(ii) of the Rights in Technical        |
# | Data and Computer Software Clause of DFARS 252.227-7013.  |
# |         MIPS Computer Systems, Inc.                       |
# |         950 DeGuigne Avenue                               |
# |         Sunnyvale, California 94088-3650, USA             |
# |-----------------------------------------------------------|
#
# $Header: firstcheck,v 1.7.2.1 92/06/24 13:34:59 marker Exp $
#	Perform the "never have been run before" checks.

set `who -r`
if [ $9 != "S" ]
then
	exit 1
fi

echo '
This machine has not been used as a customer machine yet.  The messages that
follow are from checking the built-in file systems for damage that might have
occurred during shipment.  As long as you do not see either of the messages
                                BOOT UNIX
or                      FILE SYSTEM WAS MODIFIED
all is well. If either message does come out, call your service representative.
However, the machine is still usable unless you are told otherwise.'
sleep 20
echo 'Checking file systems:
'
sync
if  /etc/fsck -y -D `sed '	/^#/d
			s/[ 	].*//' /etc/fstab`
then
	echo '\n'
else
	echo '
        WARNING: The file system check has identified serious problems.
        We strongly recommend that you contact your service representative
        before using the machine.

The power will now be turned off.
'
	sleep 4
	/etc/uadmin 2 0
fi
exit 0
