#!/bin/sh
#
# Copyright (c) 1999 Sun Microsystems, Inc., All Rights Reserved 
#
# Sun WebServer configuration postinstall
# Populate the default web server instance and site
#
INSTALL_ROOT=$BASEDIR
#
# Add symbolic links to the cgi-bin area for the template site.
#
ln -s ${INSTALL_ROOT}/opt/SUNWut/http/lib/cgi-bin/publish_script ${INSTALL_ROOT}/etc/opt/SUNWut/http/site_template/cgi-bin/
ln -s ${INSTALL_ROOT}/opt/SUNWut/http/lib/cgi-bin/test-cgi ${INSTALL_ROOT}/etc/opt/SUNWut/http/site_template/cgi-bin/
ln -s ${INSTALL_ROOT}/opt/SUNWut/http/lib/cgi-bin/import-user-cert ${INSTALL_ROOT}/etc/opt/SUNWut/http/site_template/cgi-bin/
ln -s ${INSTALL_ROOT}/opt/SUNWut/http/lib/cgi-bin/import-ca-cert ${INSTALL_ROOT}/etc/opt/SUNWut/http/site_template/cgi-bin/
ln -s ${INSTALL_ROOT}/opt/SUNWut/http/lib/cgi-bin/finger ${INSTALL_ROOT}/etc/opt/SUNWut/http/site_template/cgi-bin/

#
# Run the create_XX.sh scripts to default the default server and site.
#
if [ x"yes" = x"$BUILD_SITE" ]; then

    ${INSTALL_ROOT}/opt/SUNWut/http/lib/create_server.sh \
       sws_server \
       ${INSTALL_ROOT}/var/opt/SUNWut/http/sws_server ${INSTALL_ROOT} "-" ${HTTP_USER}
    ${INSTALL_ROOT}/opt/SUNWut/http/lib/create_site.sh \
       default_site \
       ${INSTALL_ROOT}/var/opt/SUNWut/http/sws_server/websites/default_site ${INSTALL_ROOT} "-"

    LD_LIBRARY_PATH=${INSTALL_ROOT}/opt/SUNWut/http/lib; export LD_LIBRARY_PATH;

    ${INSTALL_ROOT}/opt/SUNWut/bin/htserver add sws_server \
	${INSTALL_ROOT}/etc/opt/SUNWut/http/sws_server.httpd.conf

fi

