Subversion Repositories ALCASAR

Rev

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

Rev 3100 Rev 3179
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
 
2
 
3
# $Id: alcasar-bl.sh 3100 2022-12-29 14:45:06Z rexy $
3
# $Id: alcasar-bl.sh 3179 2024-03-03 23:23:58Z rexy $
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 207... Line 207...
207
			for x in $(ls -1 $DIR_tmp | grep "^ossi-*")
207
			for x in $(ls -1 $DIR_tmp | grep "^ossi-*")
208
			do
208
			do
209
				mv $DIR_tmp/$x $DIR_DG_BL
209
				mv $DIR_tmp/$x $DIR_DG_BL
210
			done
210
			done
211
		fi
211
		fi
212
		rm -f $BL_CATEGORIES $WL_CATEGORIES
212
		rm -f $BL_CATEGORIES $WL_CATEGORIES $WL_CATEGORIES_ENABLED
213
		rm -rf $DIR_DNS_BL $DIR_DNS_WL $DIR_IP_BL $DIR_IP_WL
213
		rm -rf $DIR_DNS_BL $DIR_DNS_WL $DIR_IP_BL $DIR_IP_WL
214
		rm -rf $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED $DIR_IP_WL_ENABLED
214
		rm -rf $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED $DIR_IP_WL_ENABLED
215
		touch $BL_CATEGORIES $WL_CATEGORIES
215
		touch $BL_CATEGORIES $WL_CATEGORIES
216
		mkdir $DIR_DNS_BL $DIR_DNS_WL $DIR_IP_BL $DIR_IP_WL
216
		mkdir $DIR_DNS_BL $DIR_DNS_WL $DIR_IP_BL $DIR_IP_WL
217
		mkdir $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED $DIR_IP_WL_ENABLED
217
		mkdir $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED $DIR_IP_WL_ENABLED
Line 221... Line 221...
221
		do
221
		do
222
			categorie=`echo $dir_categorie|cut -d "/" -f6`
222
			categorie=`echo $dir_categorie|cut -d "/" -f6`
223
			categorie_type=`grep -A1 ^NAME:[$' '$'\t']*$categorie\$ $DIR_DG_BL/global_usage | grep ^DEFAULT_TYPE | cut -d":" -f2 | tr -d " \t"`
223
			categorie_type=`grep -A1 ^NAME:[$' '$'\t']*$categorie\$ $DIR_DG_BL/global_usage | grep ^DEFAULT_TYPE | cut -d":" -f2 | tr -d " \t"`
224
			if [ "$categorie_type" == "white" ]
224
			if [ "$categorie_type" == "white" ]
225
			then
225
			then
226
				echo "$dir_categorie" >> $WL_CATEGORIES
226
				echo "$categorie" >> $WL_CATEGORIES_ENABLED
227
			else
-
 
228
				echo "$dir_categorie" >> $BL_CATEGORIES
-
 
229
			fi
227
			fi
-
 
228
			echo "$dir_categorie" >> $BL_CATEGORIES
-
 
229
			echo "$dir_categorie" >> $WL_CATEGORIES
230
		done
230
			done
231
		rm -f $FILE_tmp
231
		rm -f $FILE_tmp
232
		# Verify that the enabled categories are effectively in the BL (need after an update of the BL)
232
		# Verify that the enabled categories are effectively in the BL (need after an update of the BL)
233
		for ENABLE_CATEGORIE in `cat $BL_CATEGORIES_ENABLED`
233
		for ENABLE_CATEGORIE in `cat $BL_CATEGORIES_ENABLED`
234
		do
234
		do
235
			ok=`grep /$ENABLE_CATEGORIE$ $BL_CATEGORIES|wc -l`
235
			ok=`grep /$ENABLE_CATEGORIE$ $BL_CATEGORIES|wc -l`