#!/bin/sh
#
# Copyright (c) 1999 Sun Microsystems, Inc., All Rights Reserved 
#
# "@(#)preremove	1.1	96/11/08 SMI"
#
# 
BACKUPDIR=/var/tmp/SUNWutws/2.1
#
LD_LIBRARY_PATH=${BASEDIR}/opt/SUNWut/http/lib; export LD_LIBRARY_PATH;
#
if [ -x ${BASEDIR}/opt/SUNWut/http/bin/htserver ]; then
	${BASEDIR}/opt/SUNWut/http/bin/htserver stop 
fi;
#
# Unroll items linked in postinstall
#
/bin/rm -f ${BASEDIR}/etc/opt/SUNWut/http/site_template/cgi-bin/publish_script
/bin/rm -f ${BASEDIR}/etc/opt/SUNWut/http/site_template/cgi-bin/test-cgi
/bin/rm -f ${BASEDIR}/etc/opt/SUNWut/http/site_template/cgi-bin/finger
/bin/rm -f ${BASEDIR}/etc/opt/SUNWut/http/site_template/cgi-bin/import-user-cert
/bin/rm -f ${BASEDIR}/etc/opt/SUNWut/http/site_template/cgi-bin/import-ca-cert
#
#
# SWS configurations are open-ended, and multi-leveled, with 
# instance config files that contain paths to host config files,
# host config files that contain other config paths, and so on.
# The configurations are rooted in the /etc/opt/SUNWut/http/httpd-instances.conf
# master list.   So, on pkgrm, we take a snapshot of that file,
# so that later reinstalls of subsequent versions can track them.

if [ -r ${BASEDIR}/etc/opt/SUNWut/http/httpd-instances.conf ]; then
	mkdir -p ${BACKUPDIR}
	if [ $? -eq 0 ]; then
		cp ${BASEDIR}/etc/opt/SUNWut/http/httpd-instances.conf  ${BACKUPDIR}
	fi;
fi;

