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

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

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

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