From owner-svn-src-all@freebsd.org Wed Sep 16 23:09:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A8C9CE024; Wed, 16 Sep 2015 23:09:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5C33E1F9B; Wed, 16 Sep 2015 23:09:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8GN9WS2044821; Wed, 16 Sep 2015 23:09:32 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8GN9Wsw044820; Wed, 16 Sep 2015 23:09:32 GMT (envelope-from des@FreeBSD.org) Message-Id: <201509162309.t8GN9Wsw044820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 16 Sep 2015 23:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287880 - head/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.20 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: Wed, 16 Sep 2015 23:09:32 -0000 Author: des Date: Wed Sep 16 23:09:31 2015 New Revision: 287880 URL: https://svnweb.freebsd.org/changeset/base/287880 Log: If forwarders were specified on the command line, create an empty resolvconf.conf so that resolvconf won't replace the manually configured forwarders with dynamically configured ones the next time the lease is renewed. Modified: head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Modified: head/usr.sbin/unbound/local-setup/local-unbound-setup.sh ============================================================================== --- head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Wed Sep 16 23:01:16 2015 (r287879) +++ head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Wed Sep 16 23:09:31 2015 (r287880) @@ -172,13 +172,18 @@ do_not_edit() { # the libc resolver will try unbound first. # gen_resolvconf_conf() { + local style="$1" do_not_edit echo "resolv_conf=\"/dev/null\" # prevent updating ${resolv_conf}" - echo "unbound_conf=\"${forward_conf}\"" - echo "unbound_pid=\"${pidfile}\"" - echo "unbound_service=\"${service}\"" - # resolvconf(8) likes to restart rather than reload - echo "unbound_restart=\"service ${service} reload\"" + if [ "${style}" = "dynamic" ] ; then + echo "unbound_conf=\"${forward_conf}\"" + echo "unbound_pid=\"${pidfile}\"" + echo "unbound_service=\"${service}\"" + # resolvconf(8) likes to restart rather than reload + echo "unbound_restart=\"service ${service} reload\"" + else + echo "# Static DNS configuration" + fi } # @@ -379,6 +384,9 @@ main() { if [ -z "$forwarders" ] ; then echo "Extracting forwarders from ${resolv_conf}." forwarders=$(get_nameservers <"${resolv_conf}") + style=dynamic + else + style=static fi # @@ -440,7 +448,7 @@ main() { # instead of resolv.conf. # local tmp_resolvconf_conf=$(mktemp -u "${resolvconf_conf}.XXXXX") - gen_resolvconf_conf | unexpand >"${tmp_resolvconf_conf}" + gen_resolvconf_conf "${style}" | unexpand >"${tmp_resolvconf_conf}" replace "${resolvconf_conf}" "${tmp_resolvconf_conf}" #