> One thing the currently concerns me with this process (the way I see
it
> anyways), is that you will either have to scrap the current scripts
(or
> modify them), like the network config script, or write a routine to
parse
> the configuration information and then write it back to file without
> breaking it. I personally think that curent files provided by Charles
and
> others for Dachstein are excellent when using CLI, as they provide
options
> for doing your configuration this way, or that way; but the thought of
> parsing them leaves me sleepless at night. It would almost be better
is each
> of the configuation option sections stored the actual config in
separate
> files. ie, basic port forwarding rules in a file, advanced port
forwarding
> rules in another file, allow chains in another files, deny chains in
> another, etc. These files would contain contain just the rules or
options,
> and the network config file could then parse these files to apply the
> options. ie. basic port forwarding file would look like,
>
> #INTERN_FTP_SERVER=192.168.1.1 # Internal FTP server to make available
> #INTERN_WWW_SERVER=192.168.1.1 # Internal WWW server to make available
> #INTERN_SMTP_SERVER=192.168.1.1 # Internal SMTP server to make
available
> #INTERN_POP3_SERVER=192.168.1.1 # Internal POP3 server to make
available
> #INTERN_IMAP_SERVER=192.168.1.1 # Internal IMAP server to make
available
> #INTERN_SSH_SERVER=192.168.1.1 # Internal SSH server to make available
>
> And the advanced port forwarding would then look like:
>
> #INTERN_SERVER0="-a -P PROTO -L LADDR LPORT -R RADDR RPORT [-p PREF]"
> #INTERN_SERVER1=""
>
> If the actual config options are broken out, then I could easily have
a page
> that parses the file, displays them on a page, and then write the
whole file
> back out.
You can easily modify/hack the /etc/network.conf file to be a bunch of
smaller files using the include feature of shell-scripts. Simply
replace the above sections with something like:
source /etc/autoconfig/internal-servers
source /etc/autoconfig/advanced-port-forwarding
NOTE: "source" is not a standard shell command, but is used for
clarity...in /etc/init.d/network, source is defined as:
source () { . $1 ; }
...or you can just use the "dot" directly, ie:
. <myfile>
You could probably even get fancy, and do something like:
<network.conf>
for FILE in /etc/autoconfig/interface-* ; do
source $FILE
done
...which would automatically pick up an arbitrary number of
interfaces...of course, you'd also have to modify the IF_AUTO and
IF_LIST variables, but that should be easy to do incrementally in each
of the interface files...ie:
<network.conf>
IF_AUTO=""
IF_LIST=""
<interface-eth0>
IF_AUTO="$IF_AUTO eth0"
IF_LIST="$IF_AUTO eth0"
...remember to leave the interface out of IF_AUTO & IF_LIST if it's
configured by something else (like dhcp)!
Charles Steinkuehler
http://lrp.steinkuehler.net
http://c0wz.steinkuehler.net (lrp.c0wz.com mirror)
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
------------------------------------------------------------------------
leaf-user mailing list: [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html