#!/bin/sh
#
# /etc/rc.d/rc.httpd
#
# Start/stop/restart the Apache web server.
#
# To make Apache start automatically at boot, make this
# file executable:  chmod 750 /etc/rc.d/rc.httpd
#
conffile=/etc/apache/httpd.conf

function start() {
      if grep -q "^Include /etc/apache/mod_ssl.conf" $conffile ; then
        /usr/sbin/apachectl startssl
      else
        /usr/sbin/apachectl start
      fi
}

function stop()  {
      /usr/sbin/apachectl stop
}

function restart() {
      /usr/sbin/apachectl restart
}

# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        restart
        ;;
   *)
      echo "usage $0 start|stop|restart" ;;
esac

