#!/bin/sh
#
# Startup script for the AOLserver Web application server (RC2)
# !! for Redhat Linux >= 6.x !!
#
# $Id: aolserver,v 1.1.1.1 2000/07/17 19:50:52 biggers Exp $
#
# chkconfig: 999 99 9
# description: AOLserver is a World Wide Web application server. \
#        It is used to serve HTML files and and dynamic HTML content
# processname: nsd8x
# pidfile: ?? /var/run/nsd82.pid
# config:  ?? /etc/nsd82/conf/access.conf (dummy)
#

# Source function library.
. /etc/rc.d/init.d/functions

BASEDIR=/usr/local/aolsrv_3.0

unset QMAILMFTFILE   # avoid problems with qmail-inject!!!

AOLSRVR=$BASEDIR/bin/nsd8x
ORAINIT=/usr/local/etc/oracle8i_init.sh

if [ -f $ORAINIT ]; then  . $ORAINIT;  fi

# Depending on "invocation name", do something appropriate...

NSDCONFIG=`basename $0`

# --------------------------------
case "$1" in

  start)
    echo "Starting AOLserver.... "
    echo $AOLSRVR -t $BASEDIR/nsd.${NSDCONFIG}.tcl -u nsadmin -g users
    $AOLSRVR -t $BASEDIR/nsd.${NSDCONFIG}.tcl -u nsadmin -g users
    echo
    ;;

  stop)
    echo "Shutting down AOLserver... "
    echo $AOLSRVR -K -t $BASEDIR/nsd.${NSDCONFIG}.tcl -u nsadmin -g users
    $AOLSRVR -K -t $BASEDIR/nsd.${NSDCONFIG}.tcl -u nsadmin -g users
    echo
    ;;

  restart)
    $0 stop
    $0 start
    ;;

  status)
    status $AOLSRVR
    ;;

  reloadXX)     # rotate log files
    # echo -n "Reloading $AOLSRVR: "
    # killproc $AOLSRVRnsd82 -HUP
    # echo
    ;;

  installX)    # Install this script(s)!
    echo "installing $0 script... "
    cp -p $0 /usr/bin
    chmod 544 /usr/bin/aolserver
    /usr/bin/aolserver LinkX

    # chown root.dba /etc/rc.d/init.d/oracle8i.sh
    # chmod 554 /etc/rc.d/init.d/oracle8i.sh
    ;;

  LinkX)
    cd /usr/local/bin
    ln -s aolserver server1
    ln -s aolserver production
    ;;

  *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

exit 0
#! /bin/ksh
