From owner-freebsd-hackers Mon Sep 15 00:22:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA07860 for hackers-outgoing; Mon, 15 Sep 1997 00:22:41 -0700 (PDT) Received: from gnostic.cynic.net (gnostic.cynic.net [198.73.220.5]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id AAA07850 for ; Mon, 15 Sep 1997 00:22:37 -0700 (PDT) Received: from localhost ([[UNIX: localhost]]) by gnostic.cynic.net (8.8.5/8.6.12) with SMTP id AAA02864; Mon, 15 Sep 1997 00:22:00 -0700 (PDT) X-Authentication-Warning: gnostic.cynic.net: cjs owned process doing -bs Date: Mon, 15 Sep 1997 00:21:59 -0700 (PDT) From: Curt Sampson X-Sender: cjs@gnostic.cynic.net To: Brian Somers cc: Greg Lehey , freebsd-hackers@FreeBSD.ORG Subject: Re: rc & rc.conf In-Reply-To: <199709141135.MAA15300@awfulhak.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 14 Sep 1997, Brian Somers wrote: > The problem is that with the "= YES" bit, if you accidently leave the > variable out of rc.conf (like I did), NO is assumed. With the "!= NO" > bit, you get the program run by default and have to specifically > disable it. I got around (to some degree) this sort of thing with the following function: # $NetBSD: rc.subr,v 1.2 1997/08/30 03:34:29 cjs Exp $ # functions used by various rc scripts # Test $1 variable, and warn if not set to YES or NO. checkyesno() { eval value=\$${1}; if [ "$value" = YES ]; then return 0; else if [ "$value" != NO ]; then logger -s "WARNING: \$${1} is not set properly." fi return 1; fi } cjs Curt Sampson cjs@portal.ca Info at http://www.portal.ca/ Internet Portal Services, Inc. `And malt does more than Milton can Vancouver, BC (604) 257-9400 To justify God's ways to man.'