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

#
# Init
#
prefix=/opt/local
PID=/opt/local/var/run/maradns.pid
BIN=/opt/local/sbin/maradns

#
# Start
#
Start()
{
	[ -x ${BIN} ] && ${BIN} &; echo $! > ${PID}
}

#
# Stop
#
Stop()
{
	[ -r ${PID} ] && /bin/kill $(cat ${PID})
}

#
# Restart
#
Restart()
{
	Stop
	Start
}

#
# 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

