#!/bin/sh
# Copyright 10/15/02 Sun Microsystems, Inc. All Rights Reserved.
#
# pragma ident  "@(#)postpatch	1.2 02/10/15 Sun Microsystems"
#

if [ -z "$PKG_INSTALL_ROOT" ] ; then
    PKG_INSTALL_ROOT="/"
fi

basedir=`/usr/bin/pkgparam -R $PKG_INSTALL_ROOT SUNWescom BASEDIR`

STARTUPFILE="$PKG_INSTALL_ROOT/$basedir/SUNWsymon/startup.profile"

echo ESROOT=\`/usr/bin/pkgparam SUNWescom BASEDIR\`/SUNWsymon > $STARTUPFILE
echo export ESROOT  >> $STARTUPFILE
echo 'if [ -f "/var/opt/SUNWsymon/.java_home" ] ; then' >> $STARTUPFILE
echo '    SYMON_JAVAHOME=`/usr/bin/cat /var/opt/SUNWsymon/.java_home`' >> $STARTUPFILE
echo 'else' >> $STARTUPFILE
echo '    SYMON_JAVAHOME=/usr/java1.2' >> $STARTUPFILE
echo 'fi' >> $STARTUPFILE
echo export SYMON_JAVAHOME >> $STARTUPFILE

echo CLASSPATH=\$SYMON_JAVAHOME/jre/lib/rt.jar:\$SYMON_JAVAHOME/jre/lib/i18n.jar:\$\{ESROOT\}/jclass/chart/lib/jcchart362J.jar:\$\{ESROOT\}/classes/escon.jar:\$\{ESROOT\}/classes/esclt.jar:\$\{ESROOT\}/classes/escom.jar:\$\{ESROOT\}/classes/essrv.jar:\$\{ESROOT\}/classes/esjrm.jar:\$\{ESROOT\}/classes/xml/parser.jar >> $STARTUPFILE
echo export CLASSPATH >> $STARTUPFILE
echo PATH=/usr/sbin:/usr/bin:\$\{ESROOT\}/classes/base/console/bin:\$\{ESROOT\}/classes/base/server/bin:\$SYMON_JAVAHOME/jre/bin >> $STARTUPFILE
echo export PATH >> $STARTUPFILE

##
## start bug 4733253
##
SMCADMPATH="/var/opt/SUNWsymon/SunMC-TNG";
LOG_FILE_NAME="SunMCToTngAdaptorMain.log" ;

if [ -d $SMCADMPATH ]
then
	/usr/bin/chmod 755 $SMCADMPATH;
	if [ -f $SMCADMPATH/$LOG_FILE_NAME ]
	then
		/usr/bin/chmod 644 $SMCADMPATH/$LOG_FILE_NAME;
	fi;
fi;

## end bug 4733253

exit 0
