Subversion Repositories ALCASAR

Rev

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

Rev 1416 Rev 1482
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
 
2
 
3
# $Id: alcasar-bl.sh 1416 2014-07-22 17:12:07Z richard $
3
# $Id: alcasar-bl.sh 1482 2014-11-07 22:11:06Z 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 89... Line 89...
89
	# restoring ip files and ossi category
89
	# restoring ip files and ossi category
90
	mv $DIR_tmp/ossi $DIR_IP_BL
90
	mv $DIR_tmp/ossi $DIR_IP_BL
91
	chown apache $DIR_IP_BL/ossi
91
	chown apache $DIR_IP_BL/ossi
92
	rm -rf $DIR_tmp
92
	rm -rf $DIR_tmp
93
}
93
}
94
function bl_enable (){
-
 
95
	$SED "s/^reportinglevel =.*/reportinglevel = 3/g" /etc/dansguardian/dansguardian.conf
-
 
96
	if [ "$PARENT_SCRIPT" != "alcasar-conf.sh" ] # don't launch on install stage
-
 
97
	then
-
 
98
		/bin/systemctl restart dansguardian
-
 
99
		/bin/systemctl restart dnsmasq
-
 
100
		/bin/systemctl restart dnsmasq-blacklist
-
 
101
		/bin/systemctl restart dnsmasq-whitelist
-
 
102
		/usr/local/bin/alcasar-iptables.sh
-
 
103
	fi
-
 
104
}
94
 
105
function bl_disable (){
-
 
106
	rm -rf $DIR_DNS_BL_ENABLED/*
-
 
107
	$SED "s/^reportinglevel =.*/reportinglevel = -1/g" /etc/dansguardian/dansguardian.conf
-
 
108
	$SED "/google/d" $DNSMASQ_BL_CONF # remove nosslsearch server
-
 
109
	$SED "s?^[^#]?#&?g" $DIR_DG/urlregexplist  # remove safe searching
-
 
110
	$SED "s/^\*ip$/#*ip/g" $DIR_DG/bannedsitelist # remove pureip browsing
-
 
111
	if [ "$PARENT_SCRIPT" != "alcasar-conf.sh" ] # don't launch on install stage
-
 
112
	then
-
 
113
		/bin/systemctl restart dansguardian
-
 
114
		/bin/systemctl restart dnsmasq
-
 
115
		/bin/systemctl restart dnsmasq-blacklist
-
 
116
		/bin/systemctl restart dnsmasq-whitelist
-
 
117
		/usr/local/bin/alcasar-iptables.sh
-
 
118
	fi
-
 
119
}
-
 
120
usage="Usage: alcasar-bl.sh { -cat_choice or --cat_choice } | { -download or --download } | { -adapt or --adapt } | { -reload or --reload }"
95
usage="Usage: alcasar-bl.sh { -cat_choice or --cat_choice } | { -download or --download } | { -adapt or --adapt } | { -reload or --reload }"
121
nb_args=$#
96
nb_args=$#
122
args=$1
97
args=$1
123
if [ $nb_args -eq 0 ]
98
if [ $nb_args -eq 0 ]
124
then
99
then