#!/bin/sh
#
#ident "@(#)preinstall   1.3     99/09/26 SMI"
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
#

#
# we assume:
#
# $CLIENT_BASEDIR	set to $BASEDIR with $PKG_INSTALL_ROOT stripped off
#

#echo "begin with the $0 script"
eval=0

seterr() {
	if [ "$1" -gt "$eval" ]; then
		eval=$1
	fi
}

errout() {
	seterr $1
	#echo "done with the $0 script, exiting with $eval"
	exit $eval
}

#
trap 'echo "$0: Caught Signal"; errout 3' 1 2 3

# warn if we're not installing in /
if [ ! "$CLIENT_BASEDIR" ]; then
	CLIENT_BASEDIR=$BASEDIR
fi
#echo "\$CLIENT_BASEDIR = $CLIENT_BASEDIR"
if [ "$CLIENT_BASEDIR" != "/" ]; then
	echo "WARNING: \$CLIENT_BASEDIR '$CLIENT_BASEDIR' != /"
	seterr 2
fi
if [ "$COPY_CONFIG" = "true" ]; then
		cp -p ${PKG_INSTALL_ROOT}/etc/opt/SUNWmd/* ${PKGSAV}
fi
errout 0
