Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jan 2005 19:38:03 +0100
From:      Hexren <me@hexren.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: my lame attempt at a shell script...
Message-ID:  <15416223037.20050103193803@hexren.net>
In-Reply-To: <06DDB71C-5DB4-11D9-B56F-000D9333E43C@secure-computing.net>
References:  <06DDB71C-5DB4-11D9-B56F-000D9333E43C@secure-computing.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15416223037.20050103193803>