#!/bin/sh
#Tag 0x00000f00
#
# $Revision: 1.13 $

IS_ON=/sbin/chkconfig

if $IS_ON verbose; then
    ECHO=echo
else		# For a quiet startup and shutdown
    ECHO=:
fi

WWW=/var/www/server
HTTPD=$WWW/httpd

enableWebserver()
{
    $ECHO OutBox webserver: enabled.
    (cd $WWW; /sbin/ln -sf httpd.exe httpd)
}

disableWebserver()
{
    /sbin/rm -f $HTTPD
}


case "$1" in
  start)
	if $IS_ON ns_httpd || $IS_ON netsite; then
	    # We hope the user has made a link from Netscape server
	    # document root to the outbox docs. Otherwise outbox
	    # will not work.
	    disableWebserver
	elif $IS_ON outbox; then
	    enableWebserver
	else
	    disableWebserver
	fi
	;;

   stop)
	/sbin/killall -TERM httpd.exe
	;;

      *)
	echo "usage: $0 {start|stop}"
	;;
esac
