Subversion Repositories ALCASAR

Rev

Rev 1482 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1482 Rev 1488
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
 
2
 
3
# $Id: alcasar-bl.sh 1482 2014-11-07 22:11:06Z richard $
3
# $Id: alcasar-bl.sh 1488 2014-11-16 23:10:57Z 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 103... Line 103...
103
	-\? | -h* | --h*)
103
	-\? | -h* | --h*)
104
		echo "$usage"
104
		echo "$usage"
105
		exit 0
105
		exit 0
106
		;;
106
		;;
107
	# Retrieve Toulouse BL
107
	# Retrieve Toulouse BL
108
	-cat_choice | --cat_choice)
-
 
109
		cat_choice
-
 
110
		;;
-
 
111
	-download | --download)
108
	-download | --download)
112
		rm -rf /tmp/con_ok.html
109
		rm -rf /tmp/con_ok.html
113
		`/usr/bin/curl $BL_SERVER -# -o /tmp/con_ok.html`
110
		`/usr/bin/curl $BL_SERVER -# -o /tmp/con_ok.html`
114
		if [ ! -e /tmp/con_ok.html ]
111
		if [ ! -e /tmp/con_ok.html ]
115
		then
112
		then
Line 120... Line 117...
120
			wget -P $DIR_tmp http://$BL_SERVER/blacklists/download/blacklists.tar.gz
117
			wget -P $DIR_tmp http://$BL_SERVER/blacklists/download/blacklists.tar.gz
121
			md5sum $DIR_tmp/blacklists.tar.gz | cut -d" " -f1 > $DIR_tmp/md5sum
118
			md5sum $DIR_tmp/blacklists.tar.gz | cut -d" " -f1 > $DIR_tmp/md5sum
122
			chown -R apache:apache $DIR_tmp
119
			chown -R apache:apache $DIR_tmp
123
		fi
120
		fi
124
		;;		
121
		;;		
-
 
122
	# enable/disable categories (used only during the alcasar install process)
-
 
123
	-cat_choice | --cat_choice)
-
 
124
		cat_choice
-
 
125
		;;
125
	# Adapt Toulouse BL to ALCASAR architecture (dnsmasq + DG + iptables)
126
	# Adapt Toulouse BL to ALCASAR architecture (dnsmasq + DG + iptables)
126
	-adapt | --adapt)
127
	-adapt | --adapt)
127
		echo -n "Toulouse BlackList migration process. Please wait : "
128
		echo -n "Toulouse BlackList migration process. Please wait : "
128
		if [ ! -e $DIR_SHARE/ossi-ip-wl ]
129
		if [ ! -e $DIR_SHARE/ossi-ip-wl ]
129
		then
130
		then
Line 222... Line 223...
222
			done
223
			done
223
		fi
224
		fi
224
		cp -f $DIR_DG_BL/ossi/domains $DIR_DNS_BL/ossi.conf
225
		cp -f $DIR_DG_BL/ossi/domains $DIR_DNS_BL/ossi.conf
225
		$SED "s?.*?address=/&/$PRIVATE_IP?g" $DIR_DNS_BL/ossi.conf
226
		$SED "s?.*?address=/&/$PRIVATE_IP?g" $DIR_DNS_BL/ossi.conf
226
		cp -f $DIR_DG_BL/ossi/domains_wl $DIR_DNS_WL/ossi.conf
227
		cp -f $DIR_DG_BL/ossi/domains_wl $DIR_DNS_WL/ossi.conf
-
 
228
		systemctl restart dnsmasq-blacklist
-
 
229
		systemctl restart dnsmasq-whitelist
227
		bl_enable
230
		/usr/local/bin/alcasar-iptables.sh
228
		;;
231
		;;
229
	*)
232
	*)
230
		echo "Argument inconnu :$1";
233
		echo "Argument inconnu :$1";
231
		echo "$usage"
234
		echo "$usage"
232
		exit 1
235
		exit 1