#! /bin/sh
#
#ident	"@(#)postinstall	1.16	01/09/14 SMI"
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
#
# post-installation script for EA volume manager GUI

echo "Included with the Solaris(TM) Operating Environment are additional new"
echo "technologies developed by Sun Microsystems and made available for your"
echo "evaluation."
echo
echo "These technologies are provided to highlight future functionality being"
echo "developed for the Solaris Operating Environment. Please note any"
echo "documentation or descriptive files that call attention to its use."
echo
echo "This software is offered for evaluation purposes only and is not"
echo "recommended or intended for commercial, production, or any non-trial"
echo "deployment or use. Sun's product warranties do not extend to this software."
echo
echo "Any and all feedback on this software is welcomed by Sun Microsystems, Inc."
echo

#If smcconf is available run it, it not spit out a message to the user.

ADMIN_LIBDIR=${BASEDIR}/usr/sadm/lib
WBEM=${BASEDIR}/etc/rc2.d/S90wbem
JARCMD={BASEDIR}/usr/bin/jar
JAVACMD=${BASEDIR}/usr/bin/java
VIPER_HOME=${BASEDIR}/usr/sadm/lib/smc
export BASEDIR

export VIPER_HOME

if [ ! -x "$JAVACMD" ]; then
        echo "Missing java, unable to install the CIM objects.  After"
        echo "installing the prerequisite packages, run the following command"
        echo "to complete the installation."
        echo "${BASEDIR}/usr/sadm/bin/smcconf repository add -f bean ${BASEDIR}/usr/sadm/lib/volmgr/VVolMgr.jar" 
        exit 0
fi

JARCMD=${BASEDIR}/usr/bin/jar
if [ ! -z "$JAVA_HOME" ]; then
        JARCMD=${JAVA_HOME}/bin/jar
fi

if [ ! -x "$JARCMD" ]; then
        echo "Missing java developers environment, unable to register services."
        echo "After installing the prerequisite packages, run the following"
        echo "command to complete the installation."
        echo "${BASEDIR}/usr/sadm/bin/smcconf repository add -f bean ${BASEDIR}/
usr/sadm/lib/volmgr/VVolMgr.jar"
        exit 0
fi

if [ ! -x ${WBEM} ]; then
        echo "Missing wbem, unable to register the smc tools. After"
        echo "installing the prerequisite packages, run the following command"
        echo "to complete the installation."
        echo "${BASEDIR}/etc/rc2.d/S90 wbem stop"
        echo "${BASEDIR}/etc/rc2.d/S90 wbem start"
	exit 0
fi

${WBEM} stop >/dev/null 2>&1
${WBEM} start >/dev/null 2>&1

exit 0
