#!/bin/sh
#
# Copyright 07/27/99 Sun Microsystems, Inc.  All rights reserved.
#
# @(#)postpatch	1.8 99/07/27 Sun Microsystems, Inc.
#

#
# SUNWemmis patched var-install which itself is normally "fixed" at
# installation time for non-default installation directories.  Make
# sure that the newly patched version is similarly fixed.
#
# Initialize CMIB2GDMO compiler work files

if /usr/bin/pkginfo -q SUNWemmis; then
    installdir=`/usr/bin/pkgparam SUNWemmis BASEDIR`


runtime=/var/$installdir/SUNWconn/em
if [ ! -d $runtime ] ; then
   echo " "
   echo " Warning : EM_RUNTIME directory $runtime does not exist"
   echo " Using the default RUNTIME directory:/var/opt/SUNWconn/em"
   echo " You may need to copy EM_REFERENCED_MIB manually to resolve this"
   runtime=/var/opt/SUNWconn/em
fi
cd $runtime/data/MDR
/usr/bin/sed -e "s,\$installdir/SUNWconn/em,$installdir/SUNWconn/em," < \
       $installdir/SUNWconn/em/etc/snmp_mibs/EM_REFERENCED_MIB > \
       $runtime/data/MDR/EM_REFERENCED_MIB
/usr/bin/chmod 666 $runtime/data/MDR/EM_REFERENCED_MIB

fi

exit 0
