#!/bin/sh
#
# Preremove script for SUNWhttp 
#

# Remove pam.conf entry
RemovePam() {

	PAMTMP=/tmp/pam.conf.$$

	# discard any previous httpd entry

	grep -v '^httpd[ 	]' /etc/pam.conf > $PAMTMP
	mv $PAMTMP /etc/pam.conf
	chmod 644 /etc/pam.conf 
}

# Shut down servers
#
LD_LIBRARY_PATH=${BASEDIR}/usr/lib/http; export LD_LIBRARY_PATH;
#
${BASEDIR}/usr/bin/htserver stop 
#
#
# remove server doors

/bin/rm -f $BASEDIR/var/http/doors/.*door

# remove /etc/pam.conf entry
RemovePam
