#!/bin/sh
# 

# PROVIDE: barnyard
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable barnyard:
# barnyard_enable (bool):	Set to YES to enable barnyard
# 				Default: NO
# barnyard_flags (str):		Extra flags passed to barnyard
#				Default: -D
# barnyard_conf (str):		Barnyard configuration file
#				Default: /usr/local/etc/barnyard.conf
#
# Usage: barnyard [OPTIONS]...             (continual mode)
#    or: barnyard -o [OPTIONS]... FILES... (batch mode)
# Information Options:
#   -h         Show this help information
#   -?         Show this help information
#   -V         Show version and exit
#   -R         Display processed configuration and exit
# General Configuration Options:
#   -c <file>  Use configuration file <file>
#   -d <dir>   Read spool files from <dir>
#   -L <dir>   Write output files in <dir>
#   -v         Increase the verbosity level by 1
#   -s <file>  Read the sid-msg map from <file>
#   -g <file>  Read the gen-msg map from <file>
#   -p <file>  Read the classification map from <file>
# Continual Processing Mode Options:
#   -a <dir>   Archive processed files to <dir>
#   -f <base>  Use <base> as the base unified filename
#   -n         Only process new events
#   -w <file>  Enable bookmarking using <file>
#   -D         Run in daemon mode
#   -X <file>  Use <file> as the pid file
# Batch Processing Mode Options:
#   -o         Enable batch processing mode

. /etc/rc.subr

name="barnyard"
load_rc_config $name
rcvar=`set_rcvar`
# set some defaults
: ${barnyard_enable="NO"}
: ${barnyard_conf="/usr/local/etc/barnyard.conf"}
: ${barnyard_flags="-D"}

command="/usr/local/bin/barnyard"
command_args="-c ${barnyard_conf}"

run_rc_command "$1"
