#!/bin/ksh
#
# ident "@(#)postinstall 1.2     97/12/15 SMI"
# 
# Copyright (c) 1997, 2000 by Sun Microsystems, Inc.  All rights reserved.
#


# update httpd.conf file

hname=`hostname`

if [ -z "`/usr/bin/ps -ef|grep httpd|grep -v grep`" ]
then
	sed  -e "/new.host.name/s/#ServerName new.host.name/ServerName ${hname}/" \
	-e "/Options None/s/Options None/#Options None/" /etc/apache/httpd.conf-example > \
	/etc/apache/httpd.conf
#
	/usr/apache/bin/apachectl start > /dev/null 2>&1
	#check if httpd is started
	wait
	httpdstatus=`/usr/bin/ps -ef|grep "/usr/apache/bin/httpd"|grep -v "grep"`
	if [ $? -ne 0 ]
	then
		
		echo "WARNING:"
		echo "httpd could not be started"
	fi
 
fi
#


