#!/bin/sh
#
# webserver        Startup script for the Apache 2 Web Server
#
# chkconfig: 345 85 15
# description: Apache 2 web server startup

prog=$0

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

APACHE_HOME=/usr/local/apache2

start() {
  $APACHE_HOME/bin/apachectl startssl
  RETVAL=$?
}

stop() {
  $APACHE_HOME/bin/apachectl stop
  RETVAL=$?
}

RETVAL=0

case $1 in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    sleep 2
    start
    ;;
  status)
    status httpd
    ;;
  *)
    echo "Usage: $prog {start|stop|restart|status}"
    exit 1
    ;;
esac

exit $RETVAL
