#!/bin/sh
#
#

# PROVIDE: n4agent
# REQUIRE: SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable n4agent:
# n4agent_enable (bool):        Set to "NO" by default.
#                       Set it to "YES" to enable n4agent.
# n4agent_flags (string):       Set to "-p" by default.
#                       Extra flags passed to start command.
#
#

. /etc/rc.subr

name="n4agent"
rcvar=`set_rcvar n4agent`

# read settings, set default values
load_rc_config ${name}

: ${n4agent_enable="NO"}
: ${n4agent_flags="-e /usr/local/netams4/jserver/agent/access-ipfw.sh -c 127.0.0.1:20002 -d"}

pidfile="/var/run/${name}.pid"
command="/usr/local/sbin/${name}"
command_args="-p ${pidfile}"

run_rc_command "$1"
