#!/bin/sh
#
# $NetBSD: enma.sh,v 1.3 2010/05/28 07:26:48 obache Exp $
#
# PROVIDE: enma
# REQUIRE: NETWORK
#

. /etc/rc.subr

name="enma"
rcvar=${name}
command="/usr/pkg/libexec/enma"
pidfile="/var/run/enma/${name}.pid"
required_files="/usr/pkg/etc/enma.conf"
command_args="-c /usr/pkg/etc/enma.conf"

start_precmd="${name}_prestart"

enma_prestart()
{
	if [ ! -d /var/run/enma ]; then
		/bin/mkdir -p /var/run/enma
		/usr/sbin/chown daemon /var/run/enma
		/usr/bin/chgrp daemon /var/run/enma
		/bin/chmod 0700 /var/run/enma
	fi
}

load_rc_config ${name}
run_rc_command "$1"
