#!/bin/sh
#
# /etc/init.d/apache2
#
NAME=apache2

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

case "$1" in
    start)
	echo -n "Starting $NAME: "
	if /usr/sbin/apache2 -f @APACHECONFIG@ -k start; then
	    echo "Done"
	else
	    echo "Failed"
	fi
	;;

    stop)
	echo -n "Stopping $NAME: "
	if /usr/sbin/apache2 -f @APACHECONFIG@ -k stop; then
	    echo "Done"
	else
	    echo "Failed"
	fi
	;;

    restart)
	echo -n "Restarting $NAME: "
	if /usr/sbin/apache2 -f @APACHECONFIG@ -k restart; then
            echo "Done"
        else
	    echo "Failed"
        fi
        ;;

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