#!/bin/sh
#
# %W% %E%
#
# Copyright (c) 1999 Sun Microsystems Inc.
# All Rights Reserved
#

# Should get these from packaging?
ETCCMS=${ROOTDIR}/etc/SUNWcms
USRCMS=${ROOTDIR}/usr/platform/SUNW,Ultra-4FT/SUNWcms
CMSCFG=$ETCCMS/.config

# And now the CMS configuration files
MONLCK=$ETCCMS/.locks/cmsmonitord.lock
CMSLCK=$ETCCMS/.locks/cmsd.lock

if [ -f "$MONLCK" ]
then
	KILLPID=`cat $MONLCK`
	while kill $KILLPID 2> /dev/null
	do
		sleep 2
	done
fi

if [ -f "$CMSLCK" ]
then
	KILLPID=`cat $CMSLCK`
	KILLPID=`expr "$KILLPID" : ' *\([0-9]*\)'`
	while kill $KILLPID 2> /dev/null
	do
		sleep 2
	done
fi

rm -f $CMSCFG/configfile $CMSCFG/configfile- $CMSCFG/oldconfigfile || exit 1

exit 0

