Subversion Repositories ALCASAR

Rev

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

Rev 1060 Rev 1071
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
 
2
 
3
# $Id: alcasar-bl.sh 1060 2013-03-31 18:10:30Z richard $
3
# $Id: alcasar-bl.sh 1071 2013-04-14 19:58:17Z 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 28... Line 28...
28
DIR_DNS_WL="$DIR_SHARE/dnsmasq-wl"					# all the WL	'	'	'
28
DIR_DNS_WL="$DIR_SHARE/dnsmasq-wl"					# all the WL	'	'	'
29
DIR_IP_BL="$DIR_SHARE/iptables-bl"					# all the IP addresses of the BL 
29
DIR_IP_BL="$DIR_SHARE/iptables-bl"					# all the IP addresses of the BL 
30
DIR_DNS_BL_ENABLED="$DIR_SHARE/dnsmasq-bl-enabled"			# symbolic link to the dnsmasq	BL (only enabled categories)
30
DIR_DNS_BL_ENABLED="$DIR_SHARE/dnsmasq-bl-enabled"			# symbolic link to the dnsmasq	BL (only enabled categories)
31
DIR_DNS_WL_ENABLED="$DIR_SHARE/dnsmasq-wl-enabled"			#	'	'	'	WL	'	'	'
31
DIR_DNS_WL_ENABLED="$DIR_SHARE/dnsmasq-wl-enabled"			#	'	'	'	WL	'	'	'
32
DIR_IP_BL_ENABLED="$DIR_SHARE/iptables-bl-enabled"			#	'	'	ip BL (only enabled categories)	
32
DIR_IP_BL_ENABLED="$DIR_SHARE/iptables-bl-enabled"			#	'	'	ip BL (only enabled categories)	
-
 
33
DNSMASQ_BL_CONF="/etc/dnsmasq-blackhole.conf"				# conf file of dnsmasq-blackhole
33
BL_SERVER="dsi.ut-capitole.fr"
34
BL_SERVER="dsi.ut-capitole.fr"
34
SED="/bin/sed -i"
35
SED="/bin/sed -i"
35
 
36
 
36
# enable/disable the BL & WL categories
37
# enable/disable the BL & WL categories
37
function cat_choice (){
38
function cat_choice (){
Line 71... Line 72...
71
	fi
72
	fi
72
}
73
}
73
function bl_disable (){
74
function bl_disable (){
74
	rm -rf $DIR_DNS_BL_ENABLED/*
75
	rm -rf $DIR_DNS_BL_ENABLED/*
75
	$SED "s/^reportinglevel =.*/reportinglevel = -1/g" /etc/dansguardian/dansguardian.conf
76
	$SED "s/^reportinglevel =.*/reportinglevel = -1/g" /etc/dansguardian/dansguardian.conf
-
 
77
	$SED "/google/d" $DNSMASQ_BL_CONF # remove nosslsearch server
-
 
78
	$SED "s?^[^#]?#&?g" $DIR_DG/urlregexplist  # remove safe searching
-
 
79
	$SED "s/^\*ip$/#*ip/g" $DIR_DG/bannedsitelist # remove pureip browsing
76
	if [ "$PARENT_SCRIPT" != "alcasar-conf.sh" ] # don't launch on install stage
80
	if [ "$PARENT_SCRIPT" != "alcasar-conf.sh" ] # don't launch on install stage
77
	then
81
	then
78
		service dansguardian restart
82
		service dansguardian restart
79
		service dnsmasq restart
83
		service dnsmasq restart
80
		/usr/local/bin/alcasar-iptables.sh
84
		/usr/local/bin/alcasar-iptables.sh