Subversion Repositories ALCASAR

Rev

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

Rev 1361 Rev 1362
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
 
2
 
3
# $Id: alcasar-bl.sh 1361 2014-05-25 22:08:44Z richard $
3
# $Id: alcasar-bl.sh 1362 2014-05-26 17:12:54Z 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 141... Line 141...
141
			chown -R apache:apache $DIR_tmp
141
			chown -R apache:apache $DIR_tmp
142
		fi
142
		fi
143
		;;		
143
		;;		
144
	# Adapt Toulouse BL to ALCASAR architecture (dnsmasq + DG + iptables)
144
	# Adapt Toulouse BL to ALCASAR architecture (dnsmasq + DG + iptables)
145
	-adapt | --adapt)
145
	-adapt | --adapt)
146
		echo -n "Toulouse BlackList migration process. Please wait : "
146
		echo -n "TMigration process of Toulouse BlackList. Please wait : "
147
		# Saving IP ossi category if exist else create it (ie : during the installaton process)
147
		# Saving IP ossi category if exist else create it (ie : during the installaton process)
148
		if [ ! -f $DIR_IP_BL/ossi ]
-
 
149
		      then
-
 
150
		      touch $DIR_IP_BL/ossi
-
 
151
		      chown dansguardian:apache $DIR_IP_BL/ossi
-
 
152
		fi
-
 
153
		mv -f $DIR_IP_BL/ossi $DIR_tmp/ossi-ip
148
		[ -e $DIR_IP_BL/ossi ]	&& mv -f $DIR_IP_BL/ossi $DIR_tmp/ossi-ip
154
		if [ -f $DIR_tmp/blacklists.tar.gz ]
149
		if [ -f $DIR_tmp/blacklists.tar.gz ]
155
		then
150
		then
156
			[ -d $DIR_DG_BL/ossi ] && mv -f $DIR_DG_BL/ossi $DIR_tmp
151
			[ -d $DIR_DG_BL/ossi ] && mv -f $DIR_DG_BL/ossi $DIR_tmp
157
			rm -rf $DIR_DG_BL
152
			rm -rf $DIR_DG_BL
158
			mkdir $DIR_DG_BL
153
			mkdir $DIR_DG_BL
Line 222... Line 217...
222
				fi
217
				fi
223
			done
218
			done
224
		done
219
		done
225
		rm -f $FILE_tmp $FILE_ip_tmp
220
		rm -f $FILE_tmp $FILE_ip_tmp
226
		# Restoring ossi-IP category
221
		# Restoring ossi-IP category
227
		mv $DIR_tmp/ossi-ip $DIR_IP_BL/ossi
222
		[ -e $DIR_tmp/ossi-ip ] && mv $DIR_tmp/ossi-ip $DIR_IP_BL/ossi
228
		rm -rf $DIR_tmp
223
		rm -rf $DIR_tmp
229
		echo
224
		echo
230
		;;
225
		;;
231
	# reload when categories are changed 
226
	# reload when categories are changed 
232
	-reload | --reload)
227
	-reload | --reload)