#!/bin/sh
#
# Copyright 01/21/99 Sun Microsystems, Inc.  All rights reserved.
#
# @(#)prepatch	1.6 99/01/21 Sun Microsystems, Inc.
#

#
# If the MIS is installed on this machine, then stop it before applying
# the patch.
#

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

    #
    # Make sure the runtime environment exists, otherwise the postpatch
    # script will fail.
    #

    if [ ! -r $installdir/SUNWemrdb/etc/onconfig.em ] ; then
	echo "You must run em_services -reload before installing this patch."
	exit 1
    fi

    $installdir/SUNWconn/em/bin/em_services -force -stop

fi

exit 0
