Config file varable substitution.
guy at incentre.net
Tue Mar 21 01:25:37 CET 2006
On Mon, 2006-20-03 at 17:58 +0200, Andrey Kotrekhov wrote:
> Guy Fraser wrote:
> >I am working on a program to read the config files.
> see libConfig++ on www.sourceforge.net
> It may be what you want.
Thank you for the suggestion, but I am finished already.
I thought I specified that I was using PHP4.
I have successfully built functions to :
a) Recursively read radiusd.conf and all included files and
build an array containing all the variables with expanded
values as well as every entry from all the files.
b) Generate a formatted output that is a reasonable facsimile of
the original files maintaining the correct number of lines and
all comments for each file.
The entire program is 562 lines including gratuitous comments
debugging and a main program for testing. On the old PIII I use
for RnD it takes just over a second to read the 2086 lines of
data from the 4 files I am using, and print all the regenerated
output including all of the comments and blank lines.
The generated array is simple to use and is designed to make
accessing the raw or expanded data very easy. It would be fairly
simple to build an sql table from the array, if one wanted to.
Using this system I should be able to easily create a management
system that will allow someone to change anything in radiusd.conf
or any included file and replace the line(s) with a systematically
formatted replacement in the correct file.
Once I get a development site up, I will make the source available,
but for now, I need to build functions to access the other file
formats like the users file(s) and the dictionaries, they are
fairly simple so it shouldn't take long.
More information about the Freeradius-Devel