Subversion Repositories ALCASAR

Rev

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

Rev 1393 Rev 1395
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
 
2
 
3
# $Id: alcasar-bl.sh 1393 2014-06-19 08:44:51Z richard $
3
# $Id: alcasar-bl.sh 1395 2014-06-19 16:13:27Z 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 58... Line 58...
58
	# process the file $BL_CATEGORIES with the choice of categories 
58
	# process the file $BL_CATEGORIES with the choice of categories 
59
	for ENABLE_CATEGORIE in `cat $BL_CATEGORIES_ENABLED` 
59
	for ENABLE_CATEGORIE in `cat $BL_CATEGORIES_ENABLED` 
60
	do
60
	do
61
		$SED "/\/$ENABLE_CATEGORIE$/d" $BL_CATEGORIES 
61
		$SED "/\/$ENABLE_CATEGORIE$/d" $BL_CATEGORIES 
62
		$SED "1i\/etc\/dansguardian\/lists\/blacklists\/$ENABLE_CATEGORIE" $BL_CATEGORIES
62
		$SED "1i\/etc\/dansguardian\/lists\/blacklists\/$ENABLE_CATEGORIE" $BL_CATEGORIES
63
		ln -s $DIR_DNS_BL/$ENABLE_CATEGORIE.conf $DIR_DNS_BL_ENABLED/$ENABLE_CATEGORIE
63
		ln -sf $DIR_DNS_BL/$ENABLE_CATEGORIE.conf $DIR_DNS_BL_ENABLED/$ENABLE_CATEGORIE
64
		ln -s $DIR_IP_BL/$ENABLE_CATEGORIE $DIR_IP_BL_ENABLED/$ENABLE_CATEGORIE
64
		ln -sf $DIR_IP_BL/$ENABLE_CATEGORIE $DIR_IP_BL_ENABLED/$ENABLE_CATEGORIE
65
		# echo ".Include<$DIR_DG_BL/$ENABLE_CATEGORIE/domains>" >> $DIR_DG/bannedsitelist  # Blacklisted domains are managed by dnsmasq
65
		# echo ".Include<$DIR_DG_BL/$ENABLE_CATEGORIE/domains>" >> $DIR_DG/bannedsitelist  # Blacklisted domains are managed by dnsmasq
66
		echo ".Include<$DIR_DG_BL/$ENABLE_CATEGORIE/urls>" >> $DIR_DG/bannedurllist
66
		echo ".Include<$DIR_DG_BL/$ENABLE_CATEGORIE/urls>" >> $DIR_DG/bannedurllist
67
	done
67
	done
68
	sort +0.0 -0.2 $BL_CATEGORIES -o $FILE_tmp
68
	sort +0.0 -0.2 $BL_CATEGORIES -o $FILE_tmp
69
	mv $FILE_tmp $BL_CATEGORIES
69
	mv $FILE_tmp $BL_CATEGORIES
70
	# process the file $WL_CATEGORIES with the choice of categories 
70
	# process the file $WL_CATEGORIES with the choice of categories 
71
	for ENABLE_CATEGORIE in `cat $WL_CATEGORIES_ENABLED` 
71
	for ENABLE_CATEGORIE in `cat $WL_CATEGORIES_ENABLED` 
72
	do
72
	do
73
		$SED "/\/$ENABLE_CATEGORIE$/d" $WL_CATEGORIES 
73
		$SED "/\/$ENABLE_CATEGORIE$/d" $WL_CATEGORIES 
74
		$SED "1i\/etc\/dansguardian\/lists\/blacklists\/$ENABLE_CATEGORIE" $WL_CATEGORIES
74
		$SED "1i\/etc\/dansguardian\/lists\/blacklists\/$ENABLE_CATEGORIE" $WL_CATEGORIES
75
		ln -s $DIR_DNS_WL/$ENABLE_CATEGORIE.conf $DIR_DNS_WL_ENABLED/$ENABLE_CATEGORIE
75
		ln -sf $DIR_DNS_WL/$ENABLE_CATEGORIE.conf $DIR_DNS_WL_ENABLED/$ENABLE_CATEGORIE
76
	done
76
	done
77
	sort +0.0 -0.2 $WL_CATEGORIES -o $FILE_tmp
77
	sort +0.0 -0.2 $WL_CATEGORIES -o $FILE_tmp
78
	mv $FILE_tmp $WL_CATEGORIES
78
	mv $FILE_tmp $WL_CATEGORIES
79
	# restoring ip files and ossi category
79
	# restoring ip files and ossi category
80
	mv $DIR_tmp/ossi $DIR_IP_BL
80
	mv $DIR_tmp/ossi $DIR_IP_BL