#!/usr/bin/execlineb -P
# unbound in foreground (-d -d -p), matching debian/sv/unbound.
# Pause if unbound-checkconf fails (runit disables the service).

envfile -I /etc/default/unbound
importas -sCuD "" DAEMON_OPTS DAEMON_OPTS
envfile -I /etc/s6-rc/config/unbound.conf
importas -sCuD "-d -d -p" Args Args

ifelse { unbound-checkconf } {
	fdmove -c 2 1
	exec /usr/sbin/unbound ${Args} ${DAEMON_OPTS}
}
s6-pause
