]>
git.ipfire.org Git - people/pmueller/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 "Building blacklist databases ";
40 system("$swroot/urlfilter/bin/prebuild.pl");
43 print "Creating custom directories ";
44 mkdir("$dbdir/custom");
45 mkdir("$dbdir/custom/allowed");
46 mkdir("$dbdir/custom/blocked");
47 system("touch $dbdir/custom/allowed/domains");
48 system("touch $dbdir/custom/allowed/urls");
49 system("touch $dbdir/custom/blocked/domains");
50 system("touch $dbdir/custom/blocked/urls");
56 $swroot="/var/ipfire";
57 $logdir="/var/log/squidGuard";
58 $dbdir="/var/ipfire/urlfilter/blacklists";
60 print "Creating configuration file ";
61 foreach $blacklist (<$dbdir/*>)
65 $lastslashpos = rindex($blacklist,"/");
66 $section = substr($blacklist,$lastslashpos+1);
67 push(@categories,$section);
70 open(FILE
, ">$swroot/urlfilter/squidGuard.conf");
71 print FILE
"logdir $logdir\n";
72 print FILE
"dbhome $dbdir\n\n";
73 foreach $category (@categories)
75 print FILE
"dest $category {\n";
76 if (-e
"$dbdir/$category/domains") {
77 print FILE
" domainlist $category\/domains\n";
79 if (-e
"$dbdir/$category/urls") {
80 print FILE
" urllist $category\/urls\n";
85 print FILE
" default {\n";
86 print FILE
" pass all\n";
92 print "Building blacklist databases ";
93 system("$swroot/urlfilter/bin/prebuild.pl");
96 print "Creating custom directories ";
97 mkdir("$dbdir/custom");
98 mkdir("$dbdir/custom/allowed");
99 mkdir("$dbdir/custom/blocked");
100 system("touch $dbdir/custom/allowed/domains");
101 system("touch $dbdir/custom/allowed/urls");
102 system("touch $dbdir/custom/blocked/domains");
103 system("touch $dbdir/custom/blocked/urls");
109 $swroot="/var/ipfire";
110 $logdir="/var/log/squidGuard";
111 $dbdir="/var/ipfire/urlfilter/blacklists";
113 print "Creating configuration file ";
114 foreach $blacklist (<$dbdir/*>)
118 $lastslashpos = rindex($blacklist,"/");
119 $section = substr($blacklist,$lastslashpos+1);
120 push(@categories,$section);
123 open(FILE
, ">$swroot/urlfilter/squidGuard.conf");
124 print FILE
"logdir $logdir\n";
125 print FILE
"dbhome $dbdir\n\n";
126 foreach $category (@categories)
128 print FILE
"dest $category {\n";
129 if (-e
"$dbdir/$category/domains") {
130 print FILE
" domainlist $category\/domains\n";
132 if (-e
"$dbdir/$category/urls") {
133 print FILE
" urllist $category\/urls\n";
137 print FILE
"acl {\n";
138 print FILE
" default {\n";
139 print FILE
" pass all\n";
145 print "Building blacklist databases ";
146 system("$swroot/urlfilter/bin/prebuild.pl");
149 print "Creating custom directories ";
150 mkdir("$dbdir/custom");
151 mkdir("$dbdir/custom/allowed");
152 mkdir("$dbdir/custom/blocked");
153 system("touch $dbdir/custom/allowed/domains");
154 system("touch $dbdir/custom/allowed/urls");
155 system("touch $dbdir/custom/blocked/domains");
156 system("touch $dbdir/custom/blocked/urls");