#!/usr/bin/env /lib/runit/invoke-run
#Copyright: 2024 Dimitris T. <dimitris@stinpriza.org>
#           2026 Aitor <aitor@genuen.org>
#License: BSD-3-Clause

exec 2>&1

if ! unbound-checkconf ; then
	echo "wrong syntax in config file"
	sv d "${PWD##*/}"
	exit 162
fi

# TODO: running in chroot not supported for now

exec /usr/sbin/unbound -d -d -p
