]> git.ipfire.org Git - ipfire-2.x.git/blame - config/urlfilter/prebuild.pl
HinzugefĆ¼gt:
[ipfire-2.x.git] / config / urlfilter / prebuild.pl
CommitLineData
10e4f239
MT
1#!/usr/bin/perl
2#
3# This code is distributed under the terms of the GPL
4#
5# (c) written from scratch
6#
7# $Id: prebuild.pl,v 0.3 2005/04/16 00:00:00 marco Exp $
8#
9
10$dbdir="/var/ipfire/urlfilter/blacklists";
11
12system("/usr/bin/squidGuard -C all");
13
14if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); }
15if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); }
16if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); }
17if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); }
18
19system("chown -R nobody.nobody $dbdir");
20
21foreach $category (<$dbdir/*>)
22{
23 if (-d $category){
24 system("chmod 755 $category &> /dev/null");
25 foreach $blacklist (<$category/*>)
26 {
27 if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
28 if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
29 }
30 system("chmod 666 $category/*.db &> /dev/null");
31 }
32}
33#!/usr/bin/perl
34#
35# This code is distributed under the terms of the GPL
36#
37# (c) written from scratch
38#
39# $Id: prebuild.pl,v 0.3 2005/04/16 00:00:00 marco Exp $
40#
41
42$dbdir="/var/ipfire/urlfilter/blacklists";
43
44system("/usr/bin/squidGuard -C all");
45
46if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); }
47if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); }
48if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); }
49if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); }
50
51system("chown -R nobody.nobody $dbdir");
52
53foreach $category (<$dbdir/*>)
54{
55 if (-d $category){
56 system("chmod 755 $category &> /dev/null");
57 foreach $blacklist (<$category/*>)
58 {
59 if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
60 if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
61 }
62 system("chmod 666 $category/*.db &> /dev/null");
63 }
64}
65#!/usr/bin/perl
66#
67# This code is distributed under the terms of the GPL
68#
69# (c) written from scratch
70#
71# $Id: prebuild.pl,v 0.3 2005/04/16 00:00:00 marco Exp $
72#
73
74$dbdir="/var/ipfire/urlfilter/blacklists";
75
76system("/usr/bin/squidGuard -C all");
77
78if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); }
79if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); }
80if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); }
81if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); }
82
83system("chown -R nobody.nobody $dbdir");
84
85foreach $category (<$dbdir/*>)
86{
87 if (-d $category){
88 system("chmod 755 $category &> /dev/null");
89 foreach $blacklist (<$category/*>)
90 {
91 if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
92 if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
93 }
94 system("chmod 666 $category/*.db &> /dev/null");
95 }
96}