]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - config/urlfilter/makeconf.pl
HinzugefĆ¼gt:
[people/pmueller/ipfire-2.x.git] / config / urlfilter / makeconf.pl
CommitLineData
10e4f239
MT
1#!/usr/bin/perl
2
3$swroot="/var/ipfire";
4$logdir="/var/log/squidGuard";
5$dbdir="/var/ipfire/urlfilter/blacklists";
6
7print "Creating configuration file ";
8foreach $blacklist (<$dbdir/*>)
9{
10 if (-d $blacklist)
11 {
12 $lastslashpos = rindex($blacklist,"/");
13 $section = substr($blacklist,$lastslashpos+1);
14 push(@categories,$section);
15 }
16}
17open(FILE, ">$swroot/urlfilter/squidGuard.conf");
18print FILE "logdir $logdir\n";
19print FILE "dbhome $dbdir\n\n";
20foreach $category (@categories)
21{
22 print FILE "dest $category {\n";
23 if (-e "$dbdir/$category/domains") {
24 print FILE " domainlist $category\/domains\n";
25 }
26 if (-e "$dbdir/$category/urls") {
27 print FILE " urllist $category\/urls\n";
28 }
29 print FILE "}\n\n";
30}
31print FILE "acl {\n";
32print FILE " default {\n";
33print FILE " pass all\n";
34print FILE " }\n";
35print FILE "}\n";
36close FILE;
37print "\n";
38
39print "Building blacklist databases ";
40system("$swroot/urlfilter/bin/prebuild.pl");
41print "\n";
42
43print "Creating custom directories ";
44mkdir("$dbdir/custom");
45mkdir("$dbdir/custom/allowed");
46mkdir("$dbdir/custom/blocked");
47system("touch $dbdir/custom/allowed/domains");
48system("touch $dbdir/custom/allowed/urls");
49system("touch $dbdir/custom/blocked/domains");
50system("touch $dbdir/custom/blocked/urls");
51print "\n";
52
53exit
54#!/usr/bin/perl
55
56$swroot="/var/ipfire";
57$logdir="/var/log/squidGuard";
58$dbdir="/var/ipfire/urlfilter/blacklists";
59
60print "Creating configuration file ";
61foreach $blacklist (<$dbdir/*>)
62{
63 if (-d $blacklist)
64 {
65 $lastslashpos = rindex($blacklist,"/");
66 $section = substr($blacklist,$lastslashpos+1);
67 push(@categories,$section);
68 }
69}
70open(FILE, ">$swroot/urlfilter/squidGuard.conf");
71print FILE "logdir $logdir\n";
72print FILE "dbhome $dbdir\n\n";
73foreach $category (@categories)
74{
75 print FILE "dest $category {\n";
76 if (-e "$dbdir/$category/domains") {
77 print FILE " domainlist $category\/domains\n";
78 }
79 if (-e "$dbdir/$category/urls") {
80 print FILE " urllist $category\/urls\n";
81 }
82 print FILE "}\n\n";
83}
84print FILE "acl {\n";
85print FILE " default {\n";
86print FILE " pass all\n";
87print FILE " }\n";
88print FILE "}\n";
89close FILE;
90print "\n";
91
92print "Building blacklist databases ";
93system("$swroot/urlfilter/bin/prebuild.pl");
94print "\n";
95
96print "Creating custom directories ";
97mkdir("$dbdir/custom");
98mkdir("$dbdir/custom/allowed");
99mkdir("$dbdir/custom/blocked");
100system("touch $dbdir/custom/allowed/domains");
101system("touch $dbdir/custom/allowed/urls");
102system("touch $dbdir/custom/blocked/domains");
103system("touch $dbdir/custom/blocked/urls");
104print "\n";
105
106exit
107#!/usr/bin/perl
108
109$swroot="/var/ipfire";
110$logdir="/var/log/squidGuard";
111$dbdir="/var/ipfire/urlfilter/blacklists";
112
113print "Creating configuration file ";
114foreach $blacklist (<$dbdir/*>)
115{
116 if (-d $blacklist)
117 {
118 $lastslashpos = rindex($blacklist,"/");
119 $section = substr($blacklist,$lastslashpos+1);
120 push(@categories,$section);
121 }
122}
123open(FILE, ">$swroot/urlfilter/squidGuard.conf");
124print FILE "logdir $logdir\n";
125print FILE "dbhome $dbdir\n\n";
126foreach $category (@categories)
127{
128 print FILE "dest $category {\n";
129 if (-e "$dbdir/$category/domains") {
130 print FILE " domainlist $category\/domains\n";
131 }
132 if (-e "$dbdir/$category/urls") {
133 print FILE " urllist $category\/urls\n";
134 }
135 print FILE "}\n\n";
136}
137print FILE "acl {\n";
138print FILE " default {\n";
139print FILE " pass all\n";
140print FILE " }\n";
141print FILE "}\n";
142close FILE;
143print "\n";
144
145print "Building blacklist databases ";
146system("$swroot/urlfilter/bin/prebuild.pl");
147print "\n";
148
149print "Creating custom directories ";
150mkdir("$dbdir/custom");
151mkdir("$dbdir/custom/allowed");
152mkdir("$dbdir/custom/blocked");
153system("touch $dbdir/custom/allowed/domains");
154system("touch $dbdir/custom/allowed/urls");
155system("touch $dbdir/custom/blocked/domains");
156system("touch $dbdir/custom/blocked/urls");
157print "\n";
158
159exit