#!/bin/sh
#
# macroscope - start Macroscope daemon
#
# $FreeBSD: tags/RELEASE_8_4_0/net-mgmt/macroscope/files/macroscope.in 300897 2012-07-14 14:29:18Z beat $
# 
# PROVIDE: macroscope
# REQUIRE: DAEMON
# KEYWORD: shutdown

# -----------------------------------------------------------------------------
# macroscope_enable="NO"	# set to YES to enable macroscope
#
# # optional:
# macroscope_flags		# additional command line arguments
#

. /etc/rc.subr

name="macroscope"
rcvar=macroscope_enable

start_precmd()
{
	return 0
}

stop_postcmd()
{
	rm -f "$pidfile" || warn "Could not remove $pidfile."
}

# pidfile
eval pidfile=\$${name}_pidfile
pidfile=${pidfile:-/var/run/${name}.pid}
echo ${pidfile}

# command and arguments
command="/usr/local/sbin/${name}"

# run this first
start_precmd="start_precmd"
# and this last
stop_postcmd="stop_postcmd"

load_rc_config ${name}

command_args="--sniffer --daemon --pid ${pidfile}"

run_rc_command "$1"
