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.
35 lines
681 B
Bash
35 lines
681 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: rrdbot
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
# Add the following line to /etc/rc.conf to enable rrdbot:
|
|
# rrdbot_enable (bool): Set to "NO" by default.
|
|
# Set it to "YES" to start rrdbotd.
|
|
# rrdbot_pidfile (str): pidfile location for rrdbotd.
|
|
# Defaults to "/var/run/rrdbotd.pid".
|
|
# rrdbot_flags (str): Custom command-line flags to be passed
|
|
# to rrdbotd (default: none).
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="rrdbot"
|
|
rcvar=rrdbot_enable
|
|
|
|
load_rc_config $name
|
|
|
|
: ${rrdbot_enable="NO"}
|
|
: ${rrdbot_pidfile="/var/run/rrdbotd.pid"}
|
|
|
|
pidfile="${rrdbot_pidfile}"
|
|
|
|
command="%%PREFIX%%/sbin/rrdbotd"
|
|
command_args="-p ${rrdbot_pidfile}"
|
|
|
|
run_rc_command "$1"
|