[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Editfiles hack
From: |
Russell Adams |
Subject: |
Editfiles hack |
Date: |
Sat, 27 Mar 2004 17:32:10 -0600 |
User-agent: |
Mutt/1.4i |
I've started using the following for most of my config files. I kind
of felt it was a dirty hack, so I thought I'd ask if anyone else was
doing the same or had suggestions.
I'll use an editfiles command like the one below, basically it looks
for a revision number as the first line of the file. If it doesn't
match, then the entire file contents is replaced.
{ /etc/network/interfaces
AutoCreate
BeginGroupIfNoLineMatching "# interfaces v1.02"
EmptyEntireFilePlease
Append "# interfaces v1.02"
Append ""
Append "auto lo"
Append "iface lo inet loopback"
Append ""
Append "auto eth0"
Append "iface eth0 inet static"
Append " address 192.168.1.170"
Append " netmask 255.255.255.0"
Append " network 192.168.1.0"
Append " broadcast 192.168.1.255"
Append " gateway 192.168.1.254"
Append ""
EndGroup
}
Part of this was caused by my recent frustration trying to replace
individual lines in the above config file in a reliable manner. (ie:
replace address, but not all addresses...)
Comments?
-----------------------------
Russell Adams
RLAdams@AdamsInfoServ.com
http://www.adamsinfoserv.com/
- Editfiles hack,
Russell Adams <=