[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: (hopefully perl) API to /etc/network/interfaces?



It was suggested to me that I use a template file and continually
replace the existing configuration from that file.  This would be
simpler then a solution that is dependent on a configuration file with 
static contents....  Either the solution will work against any properly
formatted interfaces file or it has little advantage over this approach.

I could post my interfaces file, but I'd have to remove
any sensitive information.  Let's just say there are 4 interfaces
eth0(v4Internet), eth1(v4SAN), tun6to4(v6 6to4), *tunpurgatory (v6
v4tunnel to purgatory)
Given that my configuration should be duplicative.  * the
target interface for this project.

One more suggestion from you to respond to.  I've looked up the commands
to effect this change to the running config, though
this approach ignores the boot config.  It's something like...
ip tunnel show tunpurgatory; # The output is double space \0x20\0x20
records with space \0x20 separating options with there values.  Though I
don't know if I can depend on the spacing to be consistent.
ip tunnel change tunpurgatory remote; # This would change the configuration.

As this does do something, it completely ignores the repetitive task I
originally set out to automate...  That was using vi on the interfaces
file.  When I used vi on the interfaces file there were a number of
things that went through my mind.  I could likely effect the same change
with an ed script, but this could inadvertently jump over into another
interfaces definition.  That's why I'm working so hard to write a parser
for the interfaces file, to avoid editing the wrong "remote" variable.


Reply to: