#!/bin/sh

. /etc/rc.common

daemonpath="/Library/StartupItems/BFilter"
daemonname="BFilterDaemon"
daemonpid="/var/run/${daemonname}.pid"

StartService ()
{
	ConsoleMessage "Starting BFilter"
	"${daemonpath}/${daemonname}" -u nobody -g nobody -p "${daemonpid}"
	# We could also chroot to the config directory, but unfortunately
	# the SCPreferences API works with files behind the scenes.
}

StopService ()
{
	ConsoleMessage "Stopping BFilter"
	"${daemonpath}/${daemonname}" -k -p "${daemonpid}"
}

RestartService ()
{
	StopService;
	StartService;
}

RunService "$1"
