Re: includes inside squid.conf

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Wed, 3 Apr 2002 17:00:38 +0300

On 3 Apr 2002, at 10:45, Henrik Nordstrom <hno@squid-cache.org> wrote:

> On Tuesday 02 April 2002 16:32, STARYNKEVITCH Basile wrote:
>
> > We could add a patch to make the configure file optionally
> > preprocessed by an external command. A solution could be that if
> > the configure path (usually /etc/squid.conf) starts with a '!' then
> > it is a command to be piped. The patch is really trivial:
>
> Nice approach. I too like this better than my proposal with a
> separate option for the preprocessor. But there is a small problem
> here.. ! is a special character in many UNIX shells, making it hard
> to use from the command line.. (needs to be quoted in ' quotes) so I
> added | as an alternative character.
>
> What is remaining now is #line parsing.. trivial.. done.

 When I saw this proposal, my immediate thought was why not try to
 parse first line of the config file and look for #!/usr/bin/xxx
 there. Or even simply add substitute option to -f that instructs
 squid to "try" to execute (popen) the config file itself. This way
 it should be possible to easily pass arguments and pick preprocessor
 inside the config file itself.

 eg:
   squid -x /etc/squid.conf

more /etc/squid.conf
#!/usr/bin/m4 -E -s
...

 Executable config file this way can show you right away exact same
 final config that would be parsed by squid, expanding all scripting,
 if you test that on a command line.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Microlink Online
 Tel: 6501 731, Fax: 6501 725
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Wed Apr 03 2002 - 07:07:46 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:57 MST