#!/bin/sh
#
# ident "@(#)postinstall.sh 1.4     01/05/30 SMI"
#
# Copyright (c) 2000 by Sun Microsystems, Inc.
# All rights reserved.
#

BBROOT=$PKG_INSTALL_ROOT     
export BBROOT

. ${BBROOT}/etc/opt/SUNWbb/blackbox.rc

echo "postinstall"

cp $BBROOT/etc/default/init $BBROOTPATH/etc/default/init

#
# if sunray sw is already installed, then finish up
#
if [ -d /opt/SUNWut ]; then
        $BBPATH/bin/bbinstfinish
fi 

# if this is a BB system auto install, then create
# the preset number of users
if [ -f $BBAUTOINSTALL ]; then
	# have to unset BBROOT to have bbmkuser behave correctly with chroot
	BBROOT=""	
	/usr/sbin/chroot $PKG_INSTALL_ROOT \
		/$BBCHR/bin/bbmkuser -c $USERPREFIX $BASE $BBMAXUSER
else
	# this is just a webtop install ( no system install)
	# start the name service cache daemon right away  
	/etc/init.d/bbinit start
fi

