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.
41 lines
626 B
Bash
41 lines
626 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: silcd
|
|
# REQUIRE: NETWORKING
|
|
#
|
|
# Add the following line to /etc/rc.conf[.local] to enable silcd:
|
|
#
|
|
# silcd_enable="YES"
|
|
#
|
|
|
|
silcd_enable=${silcd_enable-"NO"}
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=silcd
|
|
rcvar=silcd_enable
|
|
|
|
command=%%PREFIX%%/sbin/${name}
|
|
pidfile=/var/run/${name}.pid
|
|
|
|
extra_commands="keygen"
|
|
keygen_cmd="silcd_keygen"
|
|
start_precmd="silcd_precmd"
|
|
|
|
silcd_keygen()
|
|
{
|
|
umask 077
|
|
${command} -C %%PREFIX%%/etc/silc
|
|
}
|
|
|
|
silcd_precmd()
|
|
{
|
|
if [ ! -f %%PREFIX%%/etc/silc/silcd.prv -a ! -f %%PREFIX%%/etc/silc/silcd.pub ]; then
|
|
run_rc_command keygen
|
|
fi
|
|
}
|
|
|
|
load_rc_config ${name}
|
|
run_rc_command "$1"
|