Subversion Repositories ALCASAR

Rev

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

Rev 520 Rev 521
Line 1... Line 1...
1
#/bin/sh
1
#/bin/sh
2
# $Id: alcasar-bl.sh 520 2011-03-27 20:55:05Z richard $
2
# $Id: alcasar-bl.sh 521 2011-03-27 21:37:17Z richard $
3
 
3
 
4
# Script de gestion de la BL pour le filtrage de domaine (via dnsmasq) et d'URL (via dansguardian)
4
# Script de gestion de la BL pour le filtrage de domaine (via dnsmasq) et d'URL (via dansguardian)
5
# By 3abtux & rexy
5
# By 3abtux & rexy
6
 
6
 
7
DIR_tmp="/tmp/blacklists"
7
DIR_tmp="/tmp/blacklists"
Line 97... Line 97...
97
		$SED "s?^#\"?\"?g" $DIR_DG/urlregexplist # Enable 'safesearch'
97
		$SED "s?^#\"?\"?g" $DIR_DG/urlregexplist # Enable 'safesearch'
98
		$SED "s?^DNS_FILTERING.*?DNS_FILTERING=\"yes\"?g" /usr/local/bin/alcasar-iptables.sh
98
		$SED "s?^DNS_FILTERING.*?DNS_FILTERING=\"yes\"?g" /usr/local/bin/alcasar-iptables.sh
99
		if [ "$PARENT_SCRIPT" != "/usr/local/bin/alcasar-conf.sh" ] # on ne relance lors d'une install
99
		if [ "$PARENT_SCRIPT" != "/usr/local/bin/alcasar-conf.sh" ] # on ne relance lors d'une install
100
		then
100
		then
101
		service dansguardian restart
101
		service dansguardian restart
-
 
102
		service dnsmasq restart
102
		/usr/local/bin/alcasar-iptables.sh
103
		/usr/local/bin/alcasar-iptables.sh
103
		fi
104
		fi
104
		;;
105
		;;
105
	# désactivation du filtrage
106
	# désactivation du filtrage
106
	-off | --off)
107
	-off | --off)
Line 148... Line 149...
148
				$SED "/$i/d" $DIR_DNS_FILTER_AVAILABLE/*
149
				$SED "/$i/d" $DIR_DNS_FILTER_AVAILABLE/*
149
			done
150
			done
150
		fi
151
		fi
151
		cp -f $DIR_DG_BL/ossi/domains $DIR_DNS_FILTER_AVAILABLE/ossi.conf
152
		cp -f $DIR_DG_BL/ossi/domains $DIR_DNS_FILTER_AVAILABLE/ossi.conf
152
		$SED "s?.*?address=/&/$IP_RETOUR?g" $DIR_DNS_FILTER_AVAILABLE/ossi.conf
153
		$SED "s?.*?address=/&/$IP_RETOUR?g" $DIR_DNS_FILTER_AVAILABLE/ossi.conf
153
		service dnsmasq stop
-
 
154
		sleep 1
-
 
155
		service dnsmasq start
154
		service dnsmasq restart
156
		;;
155
		;;
157
	*)
156
	*)
158
		echo "Argument inconnu :$1";
157
		echo "Argument inconnu :$1";
159
		echo "$usage"
158
		echo "$usage"
160
		exit 1
159
		exit 1