mirror of
https://git.freebsd.org/ports.git
synced 2025-06-19 11:40:31 -04:00
literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
38 lines
862 B
Bash
38 lines
862 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
|
|
#
|
|
# PROVIDE: mrtg_daemon
|
|
# REQUIRE: DAEMON bsnmpd snmpd
|
|
# KEYWORD: shutdown
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
name="mrtg_daemon"
|
|
rcvar=mrtg_daemon_enable
|
|
|
|
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
|
|
export LANG=C
|
|
}
|
|
|
|
run_rc_command "$1"
|