From owner-svn-src-all@FreeBSD.ORG Thu May 29 22:34:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6F8DB08; Thu, 29 May 2014 22:34:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA6662FA0; Thu, 29 May 2014 22:34:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TMY4mn060155; Thu, 29 May 2014 22:34:04 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TMY45I060153; Thu, 29 May 2014 22:34:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405292234.s4TMY45I060153@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 29 May 2014 22:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266863 - in head: etc/mtree usr.sbin/unbound/local-setup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 22:34:05 -0000 Author: des Date: Thu May 29 22:34:04 2014 New Revision: 266863 URL: http://svnweb.freebsd.org/changeset/base/266863 Log: Create /var/unbound/conf.d for additional configuration files. Ensure that it is used if present. MFH: 3 weeks Modified: head/etc/mtree/BSD.var.dist head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Thu May 29 21:52:42 2014 (r266862) +++ head/etc/mtree/BSD.var.dist Thu May 29 22:34:04 2014 (r266863) @@ -96,6 +96,8 @@ .. .. unbound uname=unbound gname=unbound mode=0755 + conf.d uname=unbound gname=unbound mode=0755 + .. .. yp .. Modified: head/usr.sbin/unbound/local-setup/local-unbound-setup.sh ============================================================================== --- head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu May 29 21:52:42 2014 (r266862) +++ head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu May 29 22:34:04 2014 (r266863) @@ -34,6 +34,7 @@ user="" unbound_conf="" forward_conf="" workdir="" +confdir="" chrootdir="" anchor="" pidfile="" @@ -55,6 +56,7 @@ bkext=$(date "+%Y%m%d.%H%M%S") set_defaults() { : ${user:=unbound} : ${workdir:=/var/unbound} + : ${confdir:=${workdir}/conf.d} : ${unbound_conf:=${workdir}/unbound.conf} : ${forward_conf:=${workdir}/forward.conf} : ${anchor:=${workdir}/root.key} @@ -195,6 +197,9 @@ gen_unbound_conf() { if [ -f "${forward_conf}" ] ; then echo "include: ${forward_conf}" fi + if [ -d "${confdir}" ] ; then + echo "include: ${confdir}/*.conf" + fi } # @@ -227,7 +232,8 @@ usage() { echo "options:" echo " -n do not start unbound" echo " -a path full path to trust anchor file" - echo " -c path full path to unbound configuration" + echo " -C path full path to additional configuration directory" + echo " -c path full path to unbound configuration file" echo " -f path full path to forwarding configuration" echo " -p path full path to pid file" echo " -R path full path to resolvconf.conf" @@ -247,11 +253,14 @@ main() { # # Parse and validate command-line options # - while getopts "a:c:f:np:R:r:s:u:w:" option ; do + while getopts "a:C:c:f:np:R:r:s:u:w:" option ; do case $option in a) anchor="$OPTARG" ;; + C) + confdir="$OPTARG" + ;; c) unbound_conf="$OPTARG" ;;