From owner-freebsd-questions@FreeBSD.ORG Fri Mar 24 17:12:29 2006 Return-Path: X-Original-To: FreeBSD-questions@FreeBSD.org Delivered-To: FreeBSD-questions@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 39B4D16A400 for ; Fri, 24 Mar 2006 17:12:29 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from smtp1.utdallas.edu (smtp1.utdallas.edu [129.110.10.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id A133343D69 for ; Fri, 24 Mar 2006 17:12:23 +0000 (GMT) (envelope-from pauls@utdallas.edu) Received: from utd59514.utdallas.edu (utd59514.utdallas.edu [129.110.3.28]) by smtp1.utdallas.edu (Postfix) with ESMTP id 2FEDA3895EC for ; Fri, 24 Mar 2006 11:12:23 -0600 (CST) Date: Fri, 24 Mar 2006 11:12:06 -0600 From: Paul Schmehl To: FreeBSD-questions@FreeBSD.org Message-ID: <5045F0637A62EE469942AAB4@utd59514.utdallas.edu> X-Mailer: Mulberry/4.0.0b4 (Linux/x86) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=sha1; protocol="application/pkcs7-signature"; boundary="==========15387BF1021E1D67A09F==========" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Shell scripting question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Mar 2006 17:12:29 -0000 --==========15387BF1021E1D67A09F========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I'm thinking about writing an rc.subr script that sucks in variables from a = conf file. Since the rc.firewall script does just that, I thought I'd take = a look at it. But I can't understand what it's doing. Here's the code: # Suck in the configuration variables. if [ -z "${source_rc_confs_defined}" ]; then if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi fi Neither rc.conf nor source_rc_confs appears anywhere else in the script, so = how does this suck in the variables? And what does the syntax ".=20 /etc/rc.conf" do? Here's what I understand so far. If the variable source_rc_confs_defined=20 is a zero length string, then if /etc/defaults/rc.conf is readable, then do = something with it. I have no idea what the next line "source_rc_confs"=20 does. Else, if /etc/rc.conf is readable, then do something with that. Can someone explain what all this does please? Paul Schmehl (pauls@utdallas.edu) Adjunct Information Security Officer The University of Texas at Dallas http://www.utdallas.edu/ir/security/ --==========15387BF1021E1D67A09F==========--