73f342959a
- rc.d script now generates the unbound-control keys if they don't exist and the sample config file is patched to enable this, various rc.d/unbound actions depend on this, pointed out/ok aja@
34 lines
629 B
Bash
34 lines
629 B
Bash
#!/bin/sh
|
|
#
|
|
# $OpenBSD: unbound.rc,v 1.3 2012/08/04 20:43:54 sthen Exp $
|
|
|
|
daemon="${TRUEPREFIX}/sbin/unbound-control"
|
|
daemon_flags="-c /var/unbound/etc/unbound.conf"
|
|
|
|
. /etc/rc.d/rc.subr
|
|
|
|
pexp="unbound${daemon_flags:+ ${daemon_flags}}"
|
|
rc_reload=NO
|
|
|
|
rc_pre() {
|
|
if ! [[ -f /var/unbound/etc/unbound_server.pem ||
|
|
-f /var/unbound/etc/unbound_control.key ||
|
|
-f /var/unbound/etc/unbound_control.pem ]]; then
|
|
unbound-control-setup >/dev/null 2>&1
|
|
fi
|
|
}
|
|
|
|
rc_start() {
|
|
${rcexec} "${daemon} ${daemon_flags} start"
|
|
}
|
|
|
|
rc_check() {
|
|
${daemon} ${daemon_flags} status
|
|
}
|
|
|
|
rc_stop() {
|
|
${daemon} ${daemon_flags} stop
|
|
}
|
|
|
|
rc_cmd $1
|