openbsd-ports/net/unbound/pkg/unbound.rc
sthen 73f342959a update to unbound 1.4.18; includes a crash fix (assertion failure).
- 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@
2012-08-04 20:43:54 +00:00

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