Subversion Repositories ALCASAR

Rev

Rev 1369 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1369 Rev 1370
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
 
2
 
3
# $Id: alcasar-bl.sh 1369 2014-06-03 16:23:07Z richard $
3
# $Id: alcasar-bl.sh 1370 2014-06-03 21:16:25Z richard $
4
 
4
 
5
# alcasar-bl.sh
5
# alcasar-bl.sh
6
# by Franck BOUIJOUX and Richard REY
6
# by Franck BOUIJOUX and Richard REY
7
# This script is distributed under the Gnu General Public License (GPL)
7
# This script is distributed under the Gnu General Public License (GPL)
8
 
8
 
Line 37... Line 37...
37
 
37
 
38
# enable/disable the BL & WL categories
38
# enable/disable the BL & WL categories
39
function cat_choice (){
39
function cat_choice (){
40
	# saving ip files and ossi category
40
	# saving ip files and ossi category
41
	mkdir $DIR_tmp
41
	mkdir $DIR_tmp
42
	cp $DIR_IP_BL_ENABLED/ossi-* $DIR_tmp
-
 
43
	cp $DIR_IP_BL/ossi $DIR_tmp
42
	cp $DIR_IP_BL/ossi $DIR_tmp
44
	rm -rf $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED # cleaning for dnsmasq and iptables
43
	rm -rf $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED # cleaning for dnsmasq and iptables
45
	$SED "/\.Include/d" $DIR_DG/bannedsitelist $DIR_DG/bannedurllist # cleaning for DG
44
	$SED "/\.Include/d" $DIR_DG/bannedsitelist $DIR_DG/bannedurllist # cleaning for DG
46
	$SED "s?^[^#]?#&?g" $BL_CATEGORIES $WL_CATEGORIES # cleaning BL & WL categories file (comment all lines)
45
	$SED "s?^[^#]?#&?g" $BL_CATEGORIES $WL_CATEGORIES # cleaning BL & WL categories file (comment all lines)
47
	mkdir $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED 
46
	mkdir $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED 
Line 67... Line 66...
67
	done
66
	done
68
	sort +0.0 -0.2 $WL_CATEGORIES -o $FILE_tmp
67
	sort +0.0 -0.2 $WL_CATEGORIES -o $FILE_tmp
69
	mv $FILE_tmp $WL_CATEGORIES
68
	mv $FILE_tmp $WL_CATEGORIES
70
	# restoring ip files and ossi category
69
	# restoring ip files and ossi category
71
	mv $DIR_tmp/ossi $DIR_IP_BL
70
	mv $DIR_tmp/ossi $DIR_IP_BL
72
	chown apache $DIR_IP_BL/ossi
71
	chown apache $DIR_IP_BL/*
73
	mv $DIR_tmp/ossi-* $DIR_IP_BL_ENABLED
-
 
74
	rm -rf $DIR_tmp
72
	rm -rf $DIR_tmp
75
}
73
}
76
function bl_enable (){
74
function bl_enable (){
77
	$SED "s/^reportinglevel =.*/reportinglevel = 3/g" /etc/dansguardian/dansguardian.conf
75
	$SED "s/^reportinglevel =.*/reportinglevel = 3/g" /etc/dansguardian/dansguardian.conf
78
	if [ "$PARENT_SCRIPT" != "alcasar-conf.sh" ] # don't launch on install stage
76
	if [ "$PARENT_SCRIPT" != "alcasar-conf.sh" ] # don't launch on install stage