]>
git.ipfire.org Git - ipfire-2.x.git/blob - config/urlfilter/makeconf.pl
4 $logdir="/var/log/squidGuard";
5 $dbdir="/var/ipfire/urlfilter/blacklists";
7 print "Creating configuration file ";
8 foreach $blacklist (<$dbdir/*>)
12 $lastslashpos = rindex($blacklist,"/");
13 $section = substr($blacklist,$lastslashpos+1);
14 push(@categories,$section);
17 open(FILE
, ">$swroot/urlfilter/squidGuard.conf");
18 print FILE
"logdir $logdir\n";
19 print FILE
"dbhome $dbdir\n\n";
20 foreach $category (@categories)
22 print FILE
"dest $category {\n";
23 if (-e
"$dbdir/$category/domains") {
24 print FILE
" domainlist $category\/domains\n";
26 if (-e
"$dbdir/$category/urls") {
27 print FILE
" urllist $category\/urls\n";
32 print FILE
" default {\n";
33 print FILE
" pass all\n";
39 print "Creating custom directories ";
40 mkdir("$dbdir/custom");
41 mkdir("$dbdir/custom/allowed");
42 mkdir("$dbdir/custom/blocked");
43 system("touch $dbdir/custom/allowed/domains");
44 system("touch $dbdir/custom/allowed/urls");
45 system("touch $dbdir/custom/blocked/domains");
46 system("touch $dbdir/custom/blocked/urls");
49 print "Building blacklist databases ";
50 system("$swroot/urlfilter/bin/prebuild.pl");