Shell scripting question
- From: Paul Schmehl <pauls@xxxxxxxxxxxx>
- Date: Fri, 24 Mar 2006 11:12:06 -0600
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 ". /etc/rc.conf" do?
Here's what I understand so far. If the variable source_rc_confs_defined 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" does. Else, if /etc/rc.conf is readable, then do something with that.
Can someone explain what all this does please?
Paul Schmehl (pauls@xxxxxxxxxxxx)
Adjunct Information Security Officer
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/
- Follow-Ups:
- Re: Shell scripting question
- From: Charles Swiger
- Re: Shell scripting question
- Prev by Date: Re: FreeBSD 6.1 - mount_nullfs broken?
- Next by Date: Problem installing port
- Previous by thread: portmanager configuration not working
- Next by thread: Re: Shell scripting question
- Index(es):
Relevant Pages
|