GeƤndert:
[people/pmueller/ipfire-2.x.git] / config / urlfilter / prebuild.pl
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 }