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