#!/bin/sh
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "@(#)preremove 1.0 - 01/10/17"

# Check to see if the directory server is running or configured. For either
# cases quit the pkgrm process, else continue with pkgrm.

pgrep -f "ns-slapd -D /usr/iplanet/ds5" > /dev/null
if [ $? -eq 0 ]; then
	echo "\n"
	echo "*********************************************************"
	echo "ns-slapd is running! uninstall the directory server"
	echo "before removing the package"
	echo "*********************************************************"
	echo "To preserve the server information, save the configuration"
	echo "and database files before uninstallation"
	echo "*********************************************************"
	exit 1
fi

if [ -d /usr/iplanet/ds5/slapd-* ]; then
	echo "\n"
	echo "**********************************************************"
	echo "                  server is configured"
	echo "**********************************************************"
	echo "To preserve the server information, save the configuration"
	echo "and database files before uninstallation"
	echo "**********************************************************"
	exit 1
fi
