Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1857 → Rev 1864

/scripts/alcasar-bl.sh
44,7 → 44,7
mkdir $DIR_tmp
cp $DIR_IP_BL/ossi $DIR_tmp
 
 
#ip BL ENABLE
if [ -d $DIR_IP_BL_ENABLED ]
then
for file in `ls -1 $DIR_IP_BL_ENABLED | grep -v "^ossi-*"`
56,9 → 56,24
chown apache $DIR_IP_BL_ENABLED
fi
#dns BL ENABLED
if [ -d $DIR_DNS_BL_ENABLED ]
then
for file in `ls -1 $DIR_DNS_BL_ENABLED | grep -v "^ossi-*"`
do
rm -f $DIR_DNS_BL_ENABLED/$file
done
else
mkdir $DIR_DNS_BL_ENABLED
chown apache $DIR_DNS_BL_ENABLED
fi
#ip WL ENABLE
if [ -d $DIR_IP_WL_ENABLED ]
then
for file in `ls -1 $DIR_IP_WL_ENABLED | grep -v "^ossi-*"`
for file in `ls -1 $DIR_IP_WL_ENABLED | grep -v "^ossi*"`
do
rm -f $DIR_IP_WL_ENABLED/$file
done
65,33 → 80,11
else
mkdir $DIR_IP_WL_ENABLED
chown apache $DIR_IP_WL_ENABLED
fi
 
 
 
if [ ! -e $DIR_IP_WL_ENABLED/ossi ]
then
touch $DIR_IP_WL_ENABLED/ossi
touch $DIR_IP_WL_ENABLED/ossi
chown apache $DIR_IP_WL_ENABLED/ossi
fi
 
if [ ! -e $DIR_DNS_WL/ossi.conf ]
then
touch $DIR_DNS_WL/ossi.conf
chown apache $DIR_DNS_WL/ossi.conf
ln -s $DIR_DNS_WL/ossi.conf $DIR_DNS_WL_ENABLED/ossi
fi
 
if [ -d $DIR_DNS_BL_ENABLED ]
then
for file in `ls -1 $DIR_DNS_BL_ENABLED | grep -v "^ossi-*"`
do
rm -f $DIR_DNS_BL_ENABLED/$file
done
else
mkdir $DIR_DNS_BL_ENABLED
chown apache $DIR_DNS_BL_ENABLED
fi
#dns WL ENABLED
if [ -d $DIR_DNS_WL_ENABLED ]
then
for file in `ls -1 $DIR_DNS_WL_ENABLED | grep -v "^ossi-*"`
102,6 → 95,17
mkdir $DIR_DNS_WL_ENABLED
chown apache $DIR_DNS_WL_ENABLED
fi
#dns WL ossi.conf
if [ ! -e $DIR_DNS_WL/ossi.conf ]
then
touch $DIR_DNS_WL/ossi.conf
chown apache $DIR_DNS_WL/ossi.conf
ln -s $DIR_DNS_WL/ossi.conf $DIR_DNS_WL_ENABLED/ossi
fi
 
$SED "/\.Include/d" $DIR_DG/bannedsitelist $DIR_DG/bannedurllist # cleaning for DG
$SED "s?^[^#]?#&?g" $BL_CATEGORIES $WL_CATEGORIES # cleaning BL & WL categories file (comment all lines)
# process the file $BL_CATEGORIES with the choice of categories
167,11 → 171,8
# Adapt Toulouse BL to ALCASAR architecture (dnsmasq + DG + iptables)
-adapt | --adapt)
echo -n "Toulouse BlackList migration process. Please wait : "
if [ ! -e $DIR_IP_WL_ENABLED/ossi ]
then
touch $DIR_IP_WL_ENABLED/ossi
chown apache $DIR_IP_WL_ENABLED/ossi
fi
if [ -f $DIR_tmp/blacklists.tar.gz ] # when downloading the last version of the BL
then
[ -d $DIR_DG_BL/ossi ] && mv $DIR_DG_BL/ossi $DIR_tmp