freebsd-ports/net-mgmt/mrtg/files/mrtg_daemon.sh.in
Dmitry Sivachenko de31740055 Update to 2.15.2.
PR:		112994
Submitted by:	Alexander Logvinov <ports@logvinov.com>
2007-05-30 09:26:18 +00:00

37 lines
815 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: mrtg_daemon
# REQUIRE: DAEMON bsnmpd snmpd
. %%RC_SUBR%%
name="mrtg_daemon"
rcvar=`set_rcvar`
load_rc_config $name
: ${mrtg_daemon_enable="NO"}
: ${mrtg_daemon_pidfile="/var/run/mrtg/mrtg.pid"}
: ${mrtg_daemon_user="mrtg"}
: ${mrtg_daemon_group="mrtg"}
: ${mrtg_daemon_config="%%ETCDIR%%/mrtg.cfg"}
: ${mrtg_daemon_flags="--pid-file $mrtg_daemon_pidfile --lock-file /var/run/mrtg/lockfile --confcache-file /var/run/mrtg/confcache --user $mrtg_daemon_user --group $mrtg_daemon_group --daemon $mrtg_daemon_config"}
start_precmd="mrtg_daemon_precmd"
command="%%PREFIX%%/bin/mrtg"
command_interpreter="%%PERL%%"
pidfile=${mrtg_daemon_pidfile}
mrtg_daemon_precmd()
{
rm -f /var/run/mrtg/lockfile /var/run/mrtg/confcache $mrtg_daemon_pidfile
}
run_rc_command "$1"