#!/bin/sh
#
# Sun WebServer daemon preinstall
# Copyright (c) 1999 Sun Microsystems, Inc., All Rights Reserved 
#
#
INSTALL_ROOT=$BASEDIR
#

# The request script checks for existing configurations
# and cancels the installation if found.

grep quitinstall $1
if [ $? -eq 0 ]; then
 exit 3
fi

# Is there a web server daemon installed?

if [ -f ${INSTALL_ROOT}/opt/SUNWut/http/lib/httpd ]; then

	# We need to make sure it's not SWS 1.0 
	# (which also puts httpd in /usr/lib, although it's different.)

   	pkginfo SUNWhttpu >/dev/null 2>&1
    	if [ $? -eq 0 ]; then 
	    echo "Sun WebServer 1.0 is installed on this machine."
	    echo
	    echo "Remove the packages SUNWhttpu, SUNWhttpr, and SUNWhttpv,"
	    echo "or install Sun WebServer 2.1 into a different root directory."
	    exit 3
    	fi;
fi
