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.
29 lines
588 B
Bash
29 lines
588 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: watchd
|
|
# REQUIRE: DAEMON
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following line to /etc/rc.conf[.local] to enable watchd
|
|
#
|
|
# watchd_enable (bool): Set to "NO" by default.
|
|
# Set it to "YES" to enable watchd.
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="watchd"
|
|
rcvar=watchd_enable
|
|
|
|
load_rc_config $name
|
|
|
|
: ${watchd_enable="NO"}
|
|
: ${watchd_config="%%PREFIX%%/etc/watchd.conf"}
|
|
: ${watchd_log="/var/log/watchd.log"}
|
|
|
|
command="%%PREFIX%%/bin/watchd"
|
|
command_args="${watchd_config} >> ${watchd_log}"
|
|
required_files="${watchd_config}"
|
|
|
|
run_rc_command "$1"
|