#!/bin/sh
#
# Sun WebServer configuration postinstall
# Populate the default web server instance and site
#
INSTALL_ROOT=$BASEDIR
#
# AddPam
#
# Add/replace the SUNWhttp line in pam.conf
#
AddPam() {

	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 

	echo "httpd   auth sufficient /usr/lib/security/pam_unix.so.1" >> /etc/pam.conf

}

# Create the server instance registry
/bin/touch ${INSTALL_ROOT}/etc/http/httpd-instances.conf

# Create the pam.conf entry 
#
AddPam

