155,8 → 155,38 |
rm -rf $DIR_DG_BL $DIR_IP_BL |
mkdir $DIR_DG_BL $DIR_IP_BL |
tar zxf $DIR_tmp/blacklists.tar.gz --directory=$DIR_DG/ |
# replace the global_usage file of the archive |
cp -f $GLOBAL_USAGE $DIR_DG_BL/global_usage |
chown -R e2guardian:apache $DIR_DG |
chmod -R 770 $DIR_DG |
# Add the two local categories (ossi-bl & ossi-wl) to the usage file |
# Add the custom categories (ossi-tor_nodes) to the usage file |
cat <<EOF >> $DIR_DG_BL/global_usage |
|
NAME: ossi-bl |
DEFAULT_TYPE: black |
SOURCE: ALCASAR Team |
DESC FR: sites blacklistés ajoutés localement |
DESC EN: blacklisted sites add locally |
NAME FR: ossi-bl |
NAME EN: ossi-bl |
|
NAME: ossi-wl |
DEFAULT_TYPE: white |
SOURCE: ALCASAR Team |
DESC FR: sites autorisés ajoutés localement |
DESC EN: whitelisted sites add locally |
NAME FR: ossi-wl |
NAME EN: ossi-wl |
|
NAME: ossi-bl-tor_nodes |
DEFAULT_TYPE: black |
SOURCE: ALCASAR Team |
DESC FR: Adresses IP des noeuds (routeurs) d'entrée du réseau TOR |
DESC EN: IP addresses of input TOR nodes (routers) |
NAME FR: Noeuds TOR |
NAME EN: TOR nodes |
EOF |
# Retrieve custom files (ossi) |
for x in $(ls -1 $DIR_tmp | grep "^ossi-*") |
do |
174,7 → 204,7 |
for dir_categorie in `cat $FILE_tmp` # create the blacklist and the whitelist files |
do |
categorie=`echo $dir_categorie|cut -d "/" -f6` |
categorie_type=`grep -A1 ^NAME:[$' '$'\t']*$categorie\$ $GLOBAL_USAGE | grep ^DEFAULT_TYPE | cut -d":" -f2 | tr -d " \t"` |
categorie_type=`grep -A1 ^NAME:[$' '$'\t']*$categorie\$ $DIR_DG_BL/global_usage | grep ^DEFAULT_TYPE | cut -d":" -f2 | tr -d " \t"` |
if [ "$categorie_type" == "white" ] |
then |
echo "$dir_categorie" >> $WL_CATEGORIES |