#!/bin/sh
#
# MacPorts generated daemondo support script
#

#
# Init
#
prefix=/opt/local

#
# Start
#
Start()
{
	[ -x /opt/local/sbin/apachectl ] && /opt/local/sbin/apachectl start > /dev/null
}

#
# Stop
#
Stop()
{
	[ -r /opt/local/var/run/apache2/httpd.pid ] && /opt/local/sbin/apachectl stop > /dev/null
}

#
# Restart
#
Restart()
{
	/opt/local/sbin/apachectl graceful > /dev/null
}

#
# Run
#
Run()
{
case $1 in
  start  ) Start   ;;
  stop   ) Stop    ;;
  restart) Restart ;;
  *      ) echo "$0: unknown argument: $1";;
esac
}

#
# Run a phase based on the selector
#
Run $1

