#!/bin/sh
#
# PROVIDE: iperf
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable iperf in server mode:
#
# iperf_enable="YES"
#
. /etc/rc.subr

name=iperf
rcvar=`set_rcvar`

#command=/usr/local/bin/iperf
#command_args="-s -D"

load_rc_config ${name}

iperf_enable=${iperf_enable-"NO"}

####
# iperf does not generate a pid file
# iperf_pidfile=${iperf_pidfile-"/var/run/.pid"}
# pidfile="${iperf_pidfile}"

# Quick to start iperf in deamon mode and make sure logfiles get writting in
# parseable way
start_cmd="sh -c 'iperf -s -D -y c 1>>/var/log/iperf.log 2>>/var/log/iperf.log'"

run_rc_command "$1"
