#!/bin/sh
#
#ident  "@(#)sws_tp     2.4     96/10/08 SMI"
#
# Copyright (c) 1996 by Sun Microsystems, Inc.
#
# Sun Web Server start/stop script
# This script is generally in /etc/rc2.d
#
# Modify the variables below if you would like the script to work for
#  non-default locations.

SCRIPT_NAME=`basename $0`
SCRIPT_DIR=`dirname $0`

# If SCRIPT_DIR is not an absolute path name (i.e. it doesn't begin with a '/')
# then we try to find the absolute path name using 'pwd'.

case $SCRIPT_DIR in
/* )
	;;
 * )
	INVOKING_DIRECTORY=`/usr/bin/pwd`
	SCRIPT_DIR=$INVOKING_DIRECTORY/$SCRIPT_DIR
	;;
esac

BASEDIR=$SCRIPT_DIR/../..

PATH=/sbin:/usr/bin:/usr/sbin
export PATH

# Start/stop Sun Web Server

case "$1" in
'start')

    $BASEDIR/usr/bin/htserver start
    touch $BASEDIR/var/http/.initialized
    ;;

'stop')

    $BASEDIR/usr/bin/htserver stop
    ;;

*)
    echo "Usage: $SCRIPT_NAME { start | stop }"
    ;;
esac
