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

#
# Init
#
prefix=/opt/local

#
# Start
#
Start()
{
	/opt/local/bin/webhook -hooks /opt/local/etc/webhook/hooks.json -verbose
}

#
# Stop
#
Stop()
{
	kill $(cat /opt/local/var/run/webhook.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

