On Sun, 1 Apr 2001, Darrell May wrote:

> Charlie Brady, Saturday, March 31, 2001 9:15 PM
> <snip>
> Replace localhost with ${SystemName}.${LocalDomainPrefix}${DomainName}.
> <snip>
>
> Hi Charlie, where are the above variables defined?

All of the variables in the main e-smith configuration database
/home/e-smith/configuration are available as predefined variables inside
any perl fragments in template fragments.

> In that replacing with the variables as you have mentioned and
> recreating squidGuard.conf does not replace the variables with the
> correct entries.
...
> <snip>
> # access control lists
> acl {
> # local computers
> local {
> pass trusted !ads !aggressive !audio-video !drugs !gambling...
> redirect http://$SystemName.$LocalDomainPrefix$DomainName/.....
> <snip>

The problem is probably that you don't have a perl code fragment in the
template. In order to get the correct output for the fragment you show,
you would need:

# access control lists
acl \{
# local computers
local \{
pass trusted !ads !aggressive !audio-video !drugs !gambling...
redirect http:{ "//${SystemName}.${LocalDomainPrefix}${DomainName}" }/.....
...

Or you could make the whole template fragment one {}-enclosed perl code
fragment:

{
    $OUT .= "# access control lists\n";
    $OUT .= "acl {\n";
    $OUT .= "# local computers\n";
    $OUT .= "local {\n";
    $OUT .= "pass trusted !ads !aggressive !audio-video !drugs !gambling\n";
    $OUT .= "redirect http://${SystemName}.${LocalDomainPrefix}${DomainName}/....\n";;
    ....
}

$OUT is a predefined variable in Text::Template. See "perldoc Text::Template"
for more detailes.

Regards

  Charlie Brady                         [EMAIL PROTECTED]
  http://www.e-smith.org (development)  http://www.e-smith.com (corporate)
  Phone: +1 (613) 368 4376 or 564 8000  Fax: +1 (613) 564 7739
  e-smith, inc. 1500-150 Metcalfe St, Ottawa, ON K2P 1P1 Canada


Reply via email to