]>
Commit | Line | Data |
---|---|---|
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 | ||
12 | system("/usr/bin/squidGuard -C all"); | |
13 | ||
14 | if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); } | |
15 | if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); } | |
16 | if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); } | |
17 | if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); } | |
18 | ||
19 | system("chown -R nobody.nobody $dbdir"); | |
20 | ||
21 | foreach $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 | ||
44 | system("/usr/bin/squidGuard -C all"); | |
45 | ||
46 | if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); } | |
47 | if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); } | |
48 | if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); } | |
49 | if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); } | |
50 | ||
51 | system("chown -R nobody.nobody $dbdir"); | |
52 | ||
53 | foreach $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 | ||
76 | system("/usr/bin/squidGuard -C all"); | |
77 | ||
78 | if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); } | |
79 | if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); } | |
80 | if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); } | |
81 | if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); } | |
82 | ||
83 | system("chown -R nobody.nobody $dbdir"); | |
84 | ||
85 | foreach $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 | } |