#!/sbin/sh
# 
# $Copyright
# Copyright 1993, 1994, 1995  Intel Corporation
# INTEL CONFIDENTIAL
# The technical data and computer software contained herein are subject
# to the copyright notices; trademarks; and use and disclosure
# restrictions identified in the file located in /etc/copyright on
# this system.
# Copyright$
# 
 
#
# (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC.
# ALL RIGHTS RESERVED
#
#
# OSF/1 Release 1.0

PATH=/sbin:/usr/sbin:/usr/bin
export PATH

#
# Set timezone
#
TZ=EST5EDT
if [ -s /etc/TIMEZONE ]; then
        . /etc/TIMEZONE
else
        echo "ERROR: /etc/TIMEZONE missing. Assuming $TZ"
fi
export TZ

#
# Determine action from runlevel information
#
set `who -r`
if [ $9 = "S" ]; then
        stty sane tab3 2>/dev/null
        echo "The system is coming up. Please wait..."
        BOOT=yes
elif [ $7 = "2" ]; then
        echo "Changing to system level 2."
        if [ -d /sbin/rc2.d ]; then
                for f in /sbin/rc2.d/K*
                do
                        if [ -s $f ]; then
                                /sbin/sh $f stop
                        fi
                done
        fi
fi

if [ -d /sbin/rc2.d ]; then
	mount -a -t ufs -P2 > /dev/null 2>&1
	mount -a -t ufs -P2 > /dev/null 2>&1

        for f in /sbin/rc2.d/S*
        do
                if [ -s $f ]; then
                        /sbin/sh $f start
                fi
        done
fi

if [ "$BOOT" = "yes" -a $7 = "2" ]; then
        echo "The system is ready."
elif [ $7 = "2" ]; then
        echo "Change to state 2 has been completed."
fi



