Subversion Repositories ALCASAR

Rev

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

Rev 868 Rev 878
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 868 2012-05-04 16:55:09Z richard $ 
2
#  $Id: alcasar.sh 878 2012-06-03 16:07:40Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 1261... Line 1261...
1261
BL ()
1261
BL ()
1262
{
1262
{
1263
# on copie par défaut la BL de toulouse embarqués dans l'archive d'ALCASAR
1263
# on copie par défaut la BL de toulouse embarqués dans l'archive d'ALCASAR
1264
	rm -rf $DIR_DG/lists/blacklists
1264
	rm -rf $DIR_DG/lists/blacklists
1265
	tar zxf $DIR_CONF/blacklists.tar.gz --directory=$DIR_DG/lists/ > /dev/null 2>&1
1265
	tar zxf $DIR_CONF/blacklists.tar.gz --directory=$DIR_DG/lists/ > /dev/null 2>&1
1266
# on crée le répertoire de la BL secondaire et le répertoire "pureip" (catégorie virtuelle)
1266
# on crée le répertoire ossi (noms de domaine et URLs ajoutés à la BL)
1267
	mkdir $DIR_DG/lists/blacklists/ossi $DIR_DG/lists/blacklists/ip
1267
	mkdir $DIR_DG/lists/blacklists/ossi
1268
	touch $DIR_DG/lists/blacklists/ossi/domains $DIR_DG/lists/blacklists/ip/domains
1268
	touch $DIR_DG/lists/blacklists/ossi/domains
1269
	touch $DIR_DG/lists/blacklists/ossi/urls $DIR_DG/lists/blacklists/ip/urls
1269
	touch $DIR_DG/lists/blacklists/ossi/urls
1270
# On crée les fichiers vides de sites ou d'URL réhabilités
1270
# On crée les fichiers vides de sites ou d'URL réhabilités
1271
	[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
1271
	[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
1272
	[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1272
	[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1273
	touch $DIR_DG/lists/exceptionsitelist
1273
	touch $DIR_DG/lists/exceptionsitelist
1274
	touch $DIR_DG/lists/exceptionurllist
1274
	touch $DIR_DG/lists/exceptionurllist
Line 1285... Line 1285...
1285
# block all SSL and CONNECT tunnels specified only as an IP
1285
# block all SSL and CONNECT tunnels specified only as an IP
1286
*ips
1286
*ips
1287
# block all sites specified only by an IP
1287
# block all sites specified only by an IP
1288
*ip
1288
*ip
1289
EOF
1289
EOF
-
 
1290
# On ajoute Bing et Youtube à la récriture d'URL liée au contrôle scolaire/parental
-
 
1291
	cat <<EOF >> $DIR_DG/lists/urlregexplist
-
 
1292
# Bing - add 'adlt=strict'
-
 
1293
#"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
-
 
1294
# Youtube - add 'edufilter=your_ID' 
-
 
1295
#"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=AAGG0dDxGViM51LeLNifnw"
-
 
1296
EOF
1290
	chown -R dansguardian:apache $DIR_DG
1297
	chown -R dansguardian:apache $DIR_DG
1291
	chmod -R g+rw $DIR_DG
1298
	chmod -R g+rw $DIR_DG
1292
# On crée la structure du DNS-blackhole :
1299
# On crée la structure du DNS-blackhole :
1293
  	mkdir $DIR_DEST_ETC/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
1300
  	mkdir $DIR_DEST_ETC/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
1294
	chown -R 770 $DIR_DEST_ETC/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
1301
	chown -R 770 $DIR_DEST_ETC/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}