xref: /openbsd/etc/rc.d/unbound (revision 5af055cd)
1#!/bin/sh
2#
3# $OpenBSD: unbound,v 1.3 2015/07/19 17:31:21 sthen Exp $
4
5daemon="/usr/sbin/unbound"
6daemon_flags="-c /var/unbound/etc/unbound.conf"
7
8. /etc/rc.d/rc.subr
9
10pexp="unbound${daemon_flags:+ ${daemon_flags}}"
11
12rc_pre() {
13	if grep '^[[:space:]]*auto-trust-anchor-file:' \
14            /var/unbound/etc/unbound.conf > /dev/null 2>&1; then
15		/usr/sbin/unbound-anchor -v || true
16	fi
17}
18
19rc_start() {
20	/usr/sbin/unbound-checkconf > /dev/null && \
21	    ${rcexec} "unbound ${daemon_flags}"
22}
23
24rc_cmd $1
25