From owner-freebsd-questions@FreeBSD.ORG Mon Jan 3 18:38:06 2005 Return-Path: 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 B0CA416A4CE for ; Mon, 3 Jan 2005 18:38:06 +0000 (GMT) Received: from helium.webpack.hosteurope.de (helium.webpack.hosteurope.de [217.115.142.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0741143D2D for ; Mon, 3 Jan 2005 18:38:06 +0000 (GMT) (envelope-from me@hexren.net) Received: by helium.webpack.hosteurope.de running Exim 4.34 using asmtp helo=hexren.steenbuck.net) id 1ClX5g-0008IC-IJ; Mon, 03 Jan 2005 19:38:04 +0100 Date: Mon, 3 Jan 2005 19:38:03 +0100 From: Hexren X-Mailer: The Bat! (v1.62i) Business X-Priority: 3 (Normal) Message-ID: <15416223037.20050103193803@hexren.net> To: freebsd-questions@freebsd.org In-Reply-To: <06DDB71C-5DB4-11D9-B56F-000D9333E43C@secure-computing.net> References: <06DDB71C-5DB4-11D9-B56F-000D9333E43C@secure-computing.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: my lame attempt at a shell script... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Hexren List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2005 18:38:06 -0000 EFC> Hello all, EFC> I'm trying to create a shell script for firewalling. What I'm hoping EFC> to do is create a generic script that looks for variables in EFC> /etc/rc.conf. I've tried looking at other scripts that use variables EFC> placed there, but don't understand how to pull the information from the EFC> file. EFC> Thanks for the info. EFC> _______________________________________________________ EFC> Eric F Crist "I am so smart, S.M.R.T!" EFC> Secure Computing Networks -Homer J Simpson --------------------------------------------- I am not that great at bash but look in /etc/rc.firewall for the line where it says: ". /etc/defaults/rc.conf" I think this line includes /etc/rc.conf into the running script and as code in rc.conf is evaluated at the time it is included, all the variables defined in rc.conf are created at that time in your script. (you do realize that for example gateway_enable="YES" is an variable declaration with initialization when read as shell script ?) Hexren