From owner-freebsd-hackers Wed Apr 23 17:37:02 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA03375 for hackers-outgoing; Wed, 23 Apr 1997 17:37:02 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA03365 for ; Wed, 23 Apr 1997 17:36:56 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id KAA23544; Thu, 24 Apr 1997 10:06:48 +0930 (CST) From: Michael Smith Message-Id: <199704240036.KAA23544@genesis.atrad.adelaide.edu.au> Subject: Re: /etc/netstart bogons.. In-Reply-To: <2911.861818756@time.cdrom.com> from "Jordan K. Hubbard" at "Apr 23, 97 11:05:56 am" To: jkh@time.cdrom.com (Jordan K. Hubbard) Date: Thu, 24 Apr 1997 10:06:48 +0930 (CST) Cc: hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Jordan K. Hubbard stands accused of saying: > In /etc/netstart (and elsewhere) we have constructs of the form: > > if [ "x$gateway" != "xNO" ]; then > echo 'configuring host as a gateway.' > sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1 > fi > > if [ "x$router" != "xNO" ] ; then > echo -n starting routing daemon: > echo -n " ${router}"; ${router} ${routerflags} > echo '.' > fi > > if [ "x$ipxgateway" != "xNO" ]; then > ... > > And so on. This is, needless to say, DEEPLY DEEPLY EVIL since it will > cause these features to be turned on in the _absence_ of any such flag > setting, say because you have an old /etc/sysconfig file. You make Define a helper function somewhere (/etc/sysconfig.functions?) and call it var_isset() or similar; have it return true if the value is set, and not NO. > Any objection to reversing the polarity on these various ifs? If > there's no variable or it's not explicitly set to YES, the operation > should fail. Speak now or hold your peace, please.. Make a call now as to whether empty counts as set or unset. NetBSD's convention is that set-but-empty means to use the default value, whatever that is. > Jordan -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[