From owner-freebsd-current Sat Oct 13 7:27:19 2001 Delivered-To: freebsd-current@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id D5F6537B406 for ; Sat, 13 Oct 2001 07:23:14 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 54A8914C2E; Sat, 13 Oct 2001 16:23:13 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Doug Barton Cc: freebsd-current@FreeBSD.ORG Subject: Re: Strike three, you're out References: <3BC67CBD.1DAAC031@DougBarton.net> <3BC7EA21.15F43811@DougBarton.net> From: Dag-Erling Smorgrav Date: 13 Oct 2001 16:23:12 +0200 In-Reply-To: Message-ID: Lines: 28 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dag-Erling Smorgrav writes: > I'm wondering if actually the correct solution might be to have > /etc/rc generate host.conf at boot time from the contents of > nsswitch.conf. I'll see if I can cook up an awk script to do that. This seems to do the trick: /usr/bin/awk ' BEGIN { xlat["files"] = "hosts"; xlat["dns"] = "bind"; xlat["nis"] = "nis"; } /^hosts:/ { print "# Auto-generated, do not edit"; for (n = 2; n <= NF; ++n) if ($n in xlat) print xlat[$n]; quit; } // { next; } ' /etc/nsswitch.conf >/etc/host.conf DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message