my lame attempt at a shell script...

Hexren me at hexren.net
Mon Jan 3 10:38:06 PST 2005


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



More information about the freebsd-questions mailing list