From owner-freebsd-hackers Wed Apr 23 20:05:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA11612 for hackers-outgoing; Wed, 23 Apr 1997 20:05:09 -0700 (PDT) Received: from panda.hilink.com.au (panda.hilink.com.au [203.2.144.5]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA11601 for ; Wed, 23 Apr 1997 20:05:04 -0700 (PDT) Received: (from danny@localhost) by panda.hilink.com.au (8.8.5/8.7.3) id NAA20154; Thu, 24 Apr 1997 13:04:53 +1000 (EST) Date: Thu, 24 Apr 1997 13:04:52 +1000 (EST) From: "Daniel O'Callaghan" To: "Jordan K. Hubbard" cc: David Nugent , hackers@freebsd.org Subject: Re: /etc/netstart bogons.. In-Reply-To: <8775.861847143@time.cdrom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Wed, 23 Apr 1997, Jordan K. Hubbard wrote: > > The problem is that it isn't always a "YES" that the variable is > > set to. A test for an empty variable should, however, be made the > > Well, yes, but only because our current scheme is braindead. ;-) > > > BTW, since our /bin/sh groks functions, why aren't these blocks a > > function? Something along the lines of: > > An interesting idea. One that could even be taken a little further... > > It's time to start talking in diffs. To follow. :-) One problem with the use of sh functions is that all functions must be declared before their use. See rc.serial for example of how awful this turns out to be. The "main" section of rc.serial is the last few lines in the file. But what about changing it to something like: ----------------- #!/bin/sh - # $Id: rc.net,v 1.0 . /etc/rc.d/rc.net.functions set_hostname panda.hilink.com.au tcp_extensions yes default_domainname none wma no # weak mountd authentication interface lo0 127.0.0.1 255.0.0.0 interface ed0 203.8.15.25 255.255.255.248 gateway yes defaultrouter no ...etc, etc.... ------------------ rc.net.functions of course has all of the relevant functions in it. By '.'ing rc.net.functions, rc.net stays readable. Danny