37 lines
694 B
Bash
37 lines
694 B
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: fastnetmon
|
|
# REQUIRE: NETWORKING SERVERS LOGIN
|
|
# BEFORE: securelevel
|
|
# KEYWORD: shutdown
|
|
|
|
# Add the following line to /etc/rc.conf to enable `fastnetmon':
|
|
#
|
|
#fastnetmon_enable="YES"
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="fastnetmon"
|
|
rcvar="${name}_enable"
|
|
|
|
command="/usr/local/bin/fastnetmon"
|
|
start_precmd="start_precmd"
|
|
pidfile="/var/run/$name.pid"
|
|
|
|
# read configuration and set defaults
|
|
load_rc_config "$name"
|
|
: ${fastnetmon_enable="NO"}
|
|
: ${fastnetmon_user="fastnetmon"}
|
|
#: ${fastnetmon_config="/usr/local/etc/$name.conf"}
|
|
|
|
start_precmd()
|
|
{
|
|
echo -n "Starting fastnetmon deamon:" && \
|
|
su -m $fastnetmon_user -c "$command"; && \
|
|
echo .
|
|
return 0
|
|
}
|
|
|
|
run_rc_command "$1"
|