83eb2c3700
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
925 B
Bash
38 lines
925 B
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: rtgpoll
|
|
# REQUIRE: LOGIN mysql
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
|
# to enable this service:
|
|
#
|
|
# rtgpoll_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable rtgpoll.
|
|
# rtgpoll_config (path): Set to %%PREFIX%%/etc/rtg/rtg.conf by default.
|
|
# rtgpoll_targets (path): Set to %%PREFIX%%/etc/rtg/targets.cfg by default.
|
|
# rtgpoll_pidfile (path): Set to /var/run/rtgpoll.pid by default.
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="rtgpoll"
|
|
rcvar=rtgpoll_enable
|
|
|
|
command=%%PREFIX%%/bin/${name}
|
|
|
|
load_rc_config $name
|
|
|
|
: ${rtgpoll_enable="NO"}
|
|
: ${rtgpoll_config="%%PREFIX%%/etc/rtg/rtg.conf"}
|
|
: ${rtgpoll_targets="%%PREFIX%%/etc/rtg/targets.cfg"}
|
|
: ${rtgpoll_pidfile="/var/run/${name}.pid"}
|
|
|
|
required_files="$rtgpoll_targets"
|
|
|
|
command_args="-p $rtgpoll_pidfile -c $rtgpoll_config -t $rtgpoll_targets &"
|
|
|
|
run_rc_command "$1"
|
|
|