{
    use esmith::config;
    use esmith::db;

    my %dungog;
    tie %dungog, 'esmith::config', '/home/e-smith/db/dungog';

    my %phraselist;
    tie %phraselist, 'esmith::config', '/home/e-smith/db/phraselist';

    my @lists = ();
    foreach (keys %phraselist)
    {
        push (@lists, $_)
            if (db_get_type(\%phraselist, $_) eq "list");
    }

    #domains for site
    #urls for url
    my @installed = ();
    foreach (@lists)
    {
        push (@installed, $_)
            if (-e "/etc/dansguardian/lists/phraselists/$_/exception");
    }

    $OUT = '';

    #skip if you have nothing
    my $installed = @installed || 'no lists';
    unless ($installed eq 'no lists')
    {
      $OUT .= "# phraselist includes\n";
      $OUT .= "# --------------------\n";

      foreach my $inst (@installed)
      {
        my $status = db_get_prop(\%phraselist, $inst, "f3") || '';
        if ($status eq 'on')
        {
          for ( qw(exception exception_email exception_general exception_news exception_danish exception_dutch exception_french exception_german exception_italian exception_portuguese exception_spanish) )
          {
	        if (-e "/etc/dansguardian/lists/phraselists/$inst/$_")
	        {
              $OUT .= "\.Include</etc/dansguardian/lists/phraselists/$inst/$_>\n";
            }
          }
        }
      }
    }
}