#!/bin/sh
#
# /etc/init.d/apache2
#
# $Id:$
#

NAME=apache2
#
# This is an workaround, if the path targets into a ramfs
#
mkdir -p @LOGPATH@

case "$1" in
    start)
            echo -n "${PREFIX}Starting $NAME: "
	    /usr/sbin/apache2 -f @APACHECONFIG@ -k start
	    if [ $? = 0 ]; then
                echo "Done"
            else
	        echo "Failed"
            fi
        ;;

    stop)
            echo -n "${PREFIX}Stopping $NAME: "
	    /usr/sbin/apache2 -f @APACHECONFIG@ -k stop
	    if [ $? = 0 ]; then
                echo "Done"
            else
	        echo "Failed"
            fi
        ;;

    restart)
            echo -n "${PREFIX}Restarting $NAME: "
	    /usr/sbin/apache2 -f @APACHECONFIG@ -k restart
	    if [ $? = 0 ]; then
                echo "Done"
            else
	        echo "Failed"
            fi
        ;;

    *)
        echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
        exit 1
        ;;
esac

