]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - config/urlfilter/prebuild.pl
suricata: Change midstream policy to "pass-flow"
[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
8 $dbdir="/var/ipfire/urlfilter/blacklists";
9
10 system("/usr/bin/squidGuard -C all");
11
12 system("chown -R nobody.nobody $dbdir");
13
14 &setpermissions ($dbdir);
15
16 # -------------------------------------------------------------------
17
18 sub setpermissions
19 {
20 my $bldir = $_[0];
21
22 foreach $category (<$bldir/*>)
23 {
24 if (-d $category){
25 system("chmod 755 $category &> /dev/null");
26 foreach $blacklist (<$category/*>)
27 {
28 if (-f $blacklist) { system("chmod 644 $blacklist &> /dev/null"); }
29 if (-d $blacklist) { system("chmod 755 $blacklist &> /dev/null"); }
30 }
31 system("chmod 666 $category/*.db &> /dev/null");
32 &setpermissions ($category);
33 }
34 }
35 }
36
37 # -------------------------------------------------------------------